OOPortal OOPortal

Basic COM  «Prev 

COM Type libraries

1) object, uuid 2) library MyTypeLib

Line 18: This defines the LIBID for MyTypeLib.
Line 19: This denotes the start of a type library definition. Library definitions use the library IDL keyword. The definition is delimited by curly brackets ({}).
Line 21: This imports type descriptions from standard type library stdole32.tlb, which contains COM's predefined type descriptions (i.e., IUnknown, IID_IUnknown, etc.).
Line 23: COM objects can only be defined within the scope of a type library. This defines the CLSID for MyComObject.
Line 24: IDL keyword coclass starts the definition of a COM object. This starts the descriptions of MyComObject. Like interfaces and typelibraries, the scope of a COM class description is delimited by curly brackets ({}).
Lines 26 and 27: These place interfaces IMyComInterface and IYourComInterface within MyComObject.