wchar_t attribute

The wchar_t keyword designates a wide-character type.

wchar_t identifier-name;

Parameters

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.

Remarks

The wchar_t type is a 16-bit integer which represents a UTF-16 code unit.

The underlying type of wchar_t is determined by the C or C++ compiler. For C++, you can choose the underlying type with the /Zc:wchar_t compiler option.

The MIDL compiler allows redefinition of wchar_t, but only if it is defined as an unsigned short. If you do redefine wchar_t in this way, then you must use the /Zc:wchar_t- compiler option when compiling as C++ to avoid a C++ type redefinition conflict for wchar_t. Redefining wchar_t is supported only for compatibility reasons and is not recommended.

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

char

const

Interface Definition (IDL) File

short

typedef

unsigned