在 .idl 文件中放置一个接口该接口。
[dual]
备注
当 双 C++ 特性前面接口时,它将在生成的 .idl 文件错误引起接口放置在库中块。
示例
下面的代码是特性块在接口定义之前使用 双 :
// cpp_attr_ref_dual.cpp
// compile with: /LD
#include <windows.h>
[module(name="MyLibrary")];
[uuid("2F5F63F1-16DA-11d2-9E7B-00C04FB926DA"), dual]
__interface IStatic : IDispatch 
{
   HRESULT Func1(int i);
   [   propget, 
      id(1), 
      bindable, 
      displaybind, 
      defaultbind, 
      requestedit
   ] 
   HRESULT P1([out, retval] long *nSize);
   [   propput, 
      id(1), 
      bindable, 
      displaybind, 
      defaultbind, 
      requestedit
   ] 
   HRESULT P1([in] long nSize);    
};
[cpp_quote("#include file.h")];
要求
属性上下文
适用对象  | 
interface  | 
可重复  | 
否  | 
必需的特性  | 
无  | 
无效的特性  | 
dispinterface  | 
有关更多信息,请参见 属性上下文。