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


and the program ID


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')


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




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.