共用方式為


dual

將.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

可重複

必要的屬性

None

無效的屬性

dispinterface

如需詳細資訊,請參閱屬性內容

請參閱

參考

custom (C++)

dispinterface

object (C++)

__interface

其他資源

IDL 屬性

依使用方式分類的屬性

Attributes Samples