licensed attribute
The [licensed] attribute indicates that the coclass to which it applies is licensed, and must be instantiated using IClassFactory2.
[
licensed
[ , attribute-list ]
]
coclass classname
{
coclass-definition
};
-
attribute-list
-
Specifies zero or more attributes that apply to the coclass statement. Allowable coclass attributes are [helpstring], [helpcontext], [licensed], [version], [control], and [hidden].
-
classname
-
Specifies the name by which the component object is known in the type library.
-
coclass-definition
-
Specifies statements that make up the coclass definition.
Licensing is a feature of COM that provides control over object creation. Licensed objects can be created only by clients that are authorized to use them. Licensing is implemented in COM through the IClassFactory2 interface and by support for a license key that can be passed at run time.
TYPEFLAG_FLICENSED
[
uuid(12345678-1234-1234-1234-123456789ABC),
licensed,
helpstring("A meaningfulcomment"
]
coclass MyClass
{
// coclass definition statements
};