To use Platform Invoke to call native COBOL

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