To use Platform Invoke to call native COBOL
Package your native COBOL as a
.dll
with the necessary entry points into the code.
Add the
.dll
and the COBOL run-time system support to your COBOL project as references, as follows:
Right-click
References
in the solution view on the right.
Click
Add reference
.
Browse to
MicroFocus.COBOL.Runtime
and select it.
On the Projects tab, browse to your
.dll
and select it.
Write some
.NET COBOL
to call your
.dll
, using the standard COBOL CALL statement, such as:
CALL
myNativeLibrary
USING
myParams
Now non-COBOL managed code can invoke the above
.NET COBOL
, which in turn calls the native COBOL
.dll
.
Related information
Platform Invoke and Calling Native COBOL
PInvoke Example