It effectively exposes a .NET managed class in any language as a COM interface. For more background, see the Visual Studio Help topic COM Callable Wrapper.
To expose a .NET class as a COM object, you configure the project so that the class is registered for COM interop. When you build the project, the class is registered and thereby made available to native COBOL.
All public methods defined and implemented in the .NET class are exposed as a COM interface. Your COM client application can then invoke those methods as if they were methods of a COM object.
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"
The native COBOL calls the .NET class as if it were a COM object, by including the following elements of code:
$SET OOCTRL(+P)
This checker directive enables the run-time system to map from COBOL data types to COM data types.
class-name IS CLASS "$OLE$windows-registry-name"
where windows-registry-name is one of the following:
The ProgID and CLSID are defined in the Windows registry.
Send the message "new" to the native OO COBOL proxy class. This starts the COM server if it is not already running. You are returned a native OO COBOL handle which you can use to send messages to the COM server.
When setting a property, pass a single parameter. When getting a property the value is returned as the RETURNING parameter.