coclass

[attribute-list]coclass classname { [attributes2] [interface | dispinterface] interfacename. . . };

attribute-list

The uuidWWSPKN attribute is required on a coclass. This is the same uuid that is registered as a CLSID in the system registration database. The helpstring35_B_SL, helpcontext2ML7BLI, licensed14IC0KB, version2VBLYVB, control14OLWDM, hiddenXJEF37, and appobjectZ6GEHU attributes are accepted, but not required, before a coclass definition.

classname

Name by which the common object is known in the type library.

attributes2

Optional attributes for the interface or dispinterface. The sourceFGJTDI, default18_XZUE, and restrictedO9.B_U attributes are accepted on an interface or dispinterface within a coclass.

interfacename

Either an interface declared with the interfaceXOX9ZN keyword, or a dispinterface declared with the dispinterface2_FRZT3 keyword.

 

Examples

[uuid(. . .), version(1.0), helpstring("A class"), helpcontext(2481), appobject] coclass myapp

    [source] interface IMydocfuncs : IUnknown;

    dispinterface DMydocfuncs;

};

 

[uuid(. . .)]

coclass foo

    [restricted] interface bar;

    interface baz;

}

 

Remarks

The coclass statement provides a listing of the supported interfaces for a component object.

The Microsoft  Component Object Model defines a class as an implementation that allows QueryInterface between a set of interfaces.

See Also

ODL File Syntax, ODL File Example, Generating a Type Library With MIDL, TYPEFLAGS