组件自动化
interface(组件自动化)
这个表达式定义一个接口,接口就是一个函数定义的集合.一个接口可以继承于任何基接口.
[attributes] interface interfacename[:baseinterface]{ functionlist }; |
语法元素:
attributes
在一个interface表达式前面接受dual , helpstring , helpcontext , hidden , odl , oleautomation , uuid 和 version 属性.其中 odl , uuid 属性是必须的.如果这个接口是一个COM对象的接口,source , default 和 restricted 也被接受.想了解这些属性的详细信息,可参考下一章.
interfacename
接口的名字
baseinterface
接口的父接口的名字.
functionlist
接口中每个函数的函数原形的列表.在这个函数列表中可以出现任意数量的函数定义.在函数列表中的函数定义使用下面的形式:
[attributes] returntype [calling convention] funcname(params); |
接口里一个函数定义中可以接受下面的属性:helpstring , helpcontext , string , propget , propput , propputref , bindable , defaultbind , displaybind 和