分享方式:


ms_union

控制非擷取聯集的網路資料表示對齊方式。

語法

[ms_union]

備註

ms_union C++ 屬性的功能與 MIDL 屬性ms_union 相同

範例

下列程式碼顯示ms_union 的位置

// cpp_attr_ref_ms_union.cpp
// compile with: /LD
#include <unknwn.h>
[object, ms_union, uuid("00000000-0000-0000-0000-000000000001")]
__interface IFireTabCtrl {
   HRESULT DisplayString([in, string] char * p1);
};

[export, switch_type(short)] union _WILLIE_UNION_TYPE  {
   [case(24)]
      float fMays;
   [case(25)]
      double dMcCovey;
   [default]
      int x;
};

[public] typedef _WILLIE_UNION_TYPE WILLIE_UNION_TYPE;

[module(name="ATLFIRELib")];

需求

屬性內容
適用於 非capsulated 等位
可重複 No
必要屬性
無效屬性 dispinterface

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

另請參閱

IDL 屬性
Typedef、Enum、Union 和 Struct 屬性