The set proc-pointer approach should work but you should add the $set noilnative directive to your program. When I add this to my example it will load kernel32 ok. Please note that when you load a non-COBOL .dll such as kernel32.dll in this manner using managed code, the pointer variable might still be set to null even when it is successful. This is because it is looking for a main entry point with the same name as the .dll and if it doesn't exist it will be set to null. Therefore it is difficult to check if the load was successful prior to calling the actual function.
↧