The COM-callable-wrapper (CCW) is a .NET technique for COM interoperability. CCW wraps managed code as a COM object so that native code can call it like any other COM object. 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 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 OO COBOL proxy class. This starts the COM server if it is not already running. You are returned an 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.