Problem:
When trying to run the demo ...\\Net Express 5.0\\Examples\\Visual Studio Integration\\Pinvoke on a 64 bit operating system, the demo does not run through the unmanaged call.
Resolution:
When using a 64 bit operating system, Visual Studio generates managed code for the 64 bit environment while the precompiled SUB.DLL is still 32 bits.
The given SUB.cbl has to be recompiled to a 64 bit DLL, e.g. in a 64 bit Net Express CMD prompt e.g. by the command
CBLLINK -d sub.cbl
The DLL has to be copied to the bin\\debug directory.
Starting the Visual Studio now from the Start-Menu still results in a failing call to the unmanaged code because the unmanaged runtime system set by PATH is still the 32 bit one.
When the 64 bit Net Express CMD prompt is used to start Visual Studio, e.g. by typing the solution's name, here: PInvoke.sln, then Visual Studio gets the correct environment to run the demo or debug the managed code part of the demo.