组件自动化
library(组件自动化)
这个表达式描述一个类型库.这个描述包括一个MIDL输入文件(ODL)包含的所有信息.
[attributes] library libname{
definitions
};
|
语法元素:
attributes
在一个library表达式前面接受helpstring,helpcontext,lcid,restricted,hidden,control,uuid和version属性.其中uuid属性是必须的.想了解这些属性的详细信息,可参考下一章.
libname
类型库的名字
definitions
输入库,数据类型,模块,接口,调度接口和COM类等相关的要暴露的信息的描述.
备注
library表达式必须出现在任何类型定义之前
例子
[

uuid(F37C8060-4AD5-101B-B826-00DD01103DE1), // LIBID_Hello.

helpstring("Hello 2.0 Type Library"),

lcid(0x0409),

version(2.0)

]

library Hello

 ...{

importlib("stdole.tlb");

[

uuid(F37C8062-4AD5-101B-B826-00DD01103DE1), // IID_Ihello.

helpstring("Application object for the Hello application."),

oleautomation,

dual

]

interface IHello : IDispatch

 ...{

[propget, helpstring("Returns the application of the object.")]

HRESULT Application([in, lcid] long localeID,

[out, retval] IHello** retval)

}

}
|