Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

RE: Windows API calls from managed code

$
0
0

"set ilpinvoke" was working for VC 2.3.1 but we just installed 2.3.2 and I now get this compile error:

"ILPINVOKE invalid or not allowed here".

So I removed the ilpinvoke set statements and added "set noilnative" and tried using a procedure pointer

to load kernel32.dll.  I also added a project reference to it in SysWOW64.  I'm now getting this exception when setting the procedure pointer:

System.BadImageFormatException

Could not load file or assembly 'file:///S:\V63\AWCBL\DEBUG\kernel32.dll' or one of its dependencies. The module was expected to contain an assembly manifest.

Even though I get an exception, the WINAPI calls work but I get a run time error when exiting our application:

"MgLoad has stopped working".  MgLoad is the managed driver for our application and is the first program called.

I would like to get the "set ilpinvoke" statement working again, like it did for VC 2.3.1.


Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>