组件自动化
coclass(组件自动化)
这个表达式描述一个组件对象模型(COM)的全球统一标识符和它支持的接口.
[attributes]
coclass classname {
[attributes2] [interface | dispinterface] interfacename;
};
coclass classname {
[attributes2] [interface | dispinterface] interfacename;
};
语法元素:
attributes
在coclass表达式中,uuid属性是必须的.这个uuid与在系统注册表中注册组件的CLSID是相同的.在本表达式的前面还接受 helpstring , helpcontext , version , licensed , control , hidden 与 appobject 属性,但不是必须的.想了解这些属性更多的细节,请看下一章.appobject 属性使 coclass 的函数和属性在整个类型库内有效.
classname
在类型库中标识普通对象的名字.
attributes2
interface或dispinterface的可选属性.source , default 与 restricted 属性可以被接受.
interfacename
用 interface 或 dispinterface 声明的接口.
备注
组件对象模型定义一个类作为一个实现,允许QueryInterface在接口集之间查询.
[ uuid(BFB73347-822A-1068-8849-00DD011087E8), version(1.0), helpstring("A class"), helpcontext(2481), appobject]
coclass myapp {
[source] interface IMydocfuncs;
dispinterface DMydocfuncs;
};
[uuid 00000000-0000-0000-0000-123456789019]
coclass foo
{
[restricted] interface bar;
interface bar;
}
coclass myapp {
[source] interface IMydocfuncs;
dispinterface DMydocfuncs;
};
[uuid 00000000-0000-0000-0000-123456789019]
coclass foo
{
[restricted] interface bar;
interface bar;
}
本文详细介绍了组件对象模型(COM)的coclass表达式,包括其用于描述组件全局标识符和所支持接口的功能。内容涵盖了uuid属性、可选的帮助字符串、版本信息以及接口属性如source、default和restricted等。

2947

被折叠的 条评论
为什么被折叠?



