wchar_t attribute

The wchar_t keyword designates a wide-character type.

wchar_t identifier-name;



Specifies a valid MIDL identifier. Valid MIDL identifiers consist of up to 31 alphanumeric and/or underscore characters and must start with an alphabetic or underscore character.


The wchar_t type is defined by MIDL as an unsigned short (16-bit) data object.

The MIDL compiler allows redefinition of wchar_t, but only if it is consistent with the preceding definition.

The wide-character type is one of the predefined types of MIDL. The wide-character type can appear as a type specifier in const declarations, typedef declarations, general declarations, and function declarators (as a function return type specifier and as a parameter-type specifier). For the context in which type specifiers appear, see Interface Definition (IDL) File.

The [string] attribute can be applied to a pointer or array of type wchar_t.

Use the L character before a character or a string constant to designate the wide character type constant.

See also

MIDL Base Types



Interface Definition (IDL) File