Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
COM
id
in
int
odl
out
ptr
ref
Expand Minimize

v1_enum attribute

The [v1_enum] attribute directs that the specified enumerated type be transmitted as a 32-bit entity, rather than the 16-bit default.


[v1_enum] enum 
{
    ...
};

Parameters

This attribute has no parameters.

Remarks

Using the [v1_enum] attribute to transmit an enumerated type as a 32-bit entity increases the efficiency of marshaling and unmarshaling data when such an enumeration is embedded in structures or unions.

For improved performance, we recommend applying the [v1_enum] attribute to enumerators in 32-bit applications. Keep in mind, however, that on 16-bit platforms the C compiler treats an enumerated type as a 16-bit int. Therefore 16-bit client applications need to convert enum types to long for remote transmission in order to avoid overwriting data or sending incorrect values.

Examples

typedef [v1_enum] enum 
{
    value1, 
    value2, ...
};

See also

enum
Interface Definition (IDL) File
long

 

 

Community Additions

ADD
Show:
© 2015 Microsoft