ms_union

控件 nonencapsulated 联合的网络数据表示形式对齐。

[ms_union]

备注

ms_union C++ 特性具有与 ms_union MIDL 属性相同。

示例

下面的代码演示 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")];

要求

属性上下文

适用对象

Nonencapsulated 联合

可重复

必需的特性

无效的特性

dispinterface

有关更多信息,请参见 属性上下文

请参见

其他资源

IDL特性

Typedef、枚举、联合和Struct属性

Attributes Samples