ms_union
Controls the network data representation alignment of nonencapsulated unions.
Syntax
[ms_union]
Remarks
The ms_union C++ attribute has the same functionality as the ms_union MIDL attribute.
Example
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")];
Requirements
Attribute context | Value |
---|---|
Applies to | Nonencapsulated unions |
Repeatable | No |
Required attributes | None |
Invalid attributes | dispinterface |
For more information, see Attribute Contexts.
See also
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho