Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The coclass statement provides a listing of the supported interfaces for a component object.
[
coclass-attribute-list
]
coclass classname
{
[
interface-attributes
]
[interface | dispinterface] interfacename
{
. . .
}
}
coclass-attribute-list
The [uuid] attribute is required on a coclass. This is the same [uuid] that is registered as a CLSID in the system registration database. The [helpstring], [helpcontext], [licensed], [version], [control], [hidden], and [appobject] attributes are accepted, but not required, before a coclass definition.
classname
Name by which the common object is known in the type library.
interface-attributes
Optional attributes for the interface or dispinterface. The [source], [default], and [restricted] attributes are accepted on an interface or dispinterface within a coclass.
interfacename
Either an interface declared with the interface keyword, or a dispinterface declared with the dispinterface keyword.
The Microsoft Component Object Model defines a class as an implementation that allows QueryInterface between a set of interfaces.
[
uuid(1e196b20-1f3c-1069-996b-00dd010fe676),
version(1.0),
helpstring("A class"),
helpcontext(2481), appobject
]
coclass myapp
{
[source] interface IMydocfuncs : IUnknown;
dispinterface DMydocfuncs;
};
[
uuid(12345678-1234-1234-1234-123456789ABC)
]
coclass mycoclass
{
[restricted] interface iface1;
interface iface2;
}
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today