To expose a COM object as an IDL object, use the OBJ_NEW function to create a dynamic subclass of the IDLcomIDispatch object class. The name of the subclass must be constructed as described in IDLcomIDispatch Object Naming Scheme, and identifies the COM object to be instantiated.
For example, suppose you wish to include a COM component with the class ID
{A77BC2B2-88EC-4D2A-B2B3-F556ACB52E52}
and the program ID
RSIDemoComponent.RSIDemoObj1.1
in an IDL program. Use either of the following calls to the OBJ_NEW function:
ObjRef = OBJ_NEW('IDLcomIDispatch$CLSID$A77BC2B2_88EC_4D2A_B2B3_F556ACB52E52')
or
ObjRef = OBJ_NEW('IDLcomIDispatch$PROGID$RSIDemoComponent_RSIDemoObj1_1')
IDL’s internal COM subsystem instantiates the COM object within an IDLcomIDispatch object with one of the following the dynamic class names
IDLcomIDispatch$CLSID$A77BC2B2_88EC_4D2A_B2B3_F556ACB52E52
or
IDLcomIDispatch$PROGID$RSIDemoComponent_RSIDemoObj1_1
and sets up communication between the object and IDL. You can work with the IDLcomIDispatch object just as you would with any other IDL object; calling the object’s methods, and getting and setting its properties.
See IDLcomIDispatch for additional details.