To expose a .NET class to native COBOL, using CCW

  1. In Visual Studio, open the project containing the .NET class to expose, by clicking File > Open > Project and browsing to the project.
  2. Click Project > myProject Properties.
  3. On the COBOL tab, click Advanced, and check Register for COM interop.

    The native client can now invoke methods in the .NET class as if it was any other COM object, by using the COM programmatic ID of the .NET class. This ID is defined as DefaultNamespace.Class. Where the default namespace, DefaultNamespace, is defined on the Application tab in the project properties and is by default set to the name of the project.

    For example, a native COBOL client can invoke the .NET class called ManagedCOM, as follows:

    class ManagedCOM as "$OLE$COMDemo.ManagedCOM"