| title |
ms_union | Microsoft Docs |
| ms.custom |
|
| ms.date |
11/04/2016 |
| ms.reviewer |
|
| ms.suite |
|
| ms.technology |
|
| ms.tgt_pltfrm |
|
| ms.topic |
language-reference |
| f1_keywords |
|
| dev_langs |
|
| helpviewer_keywords |
|
| ms.assetid |
bb548689-6962-457e-af56-8ffdf68987eb |
| caps.latest.revision |
9 |
| author |
mikeblome |
| ms.author |
mblome |
| manager |
ghogen |
| translation.priority.ht |
cs-cz |
de-de |
es-es |
fr-fr |
it-it |
ja-jp |
ko-kr |
pl-pl |
pt-br |
ru-ru |
tr-tr |
zh-cn |
zh-tw |
|
Controls the network data representation alignment of nonencapsulated unions.
Remarks
The ms_union C++ attribute has the same functionality as the ms_union MIDL attribute.
The following code shows the placement of 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")];
|
|
| Applies to |
Nonencapsulated unions |
| Repeatable |
No |
| Required attributes |
None |
| Invalid attributes |
dispinterface |
For more information, see Attribute Contexts.
IDL Attributes
Typedef, Enum, Union, and Struct Attributes