The TEXT macro identifies a string as Unicode when the UNICODE is defined during compilation. Otherwise, it identifies a string as an ANSI string. TEXT( LPTSTR string // ANSI or Unicode string ); Parameters string Pointer to the string to be interpreted as either Unicode or ANSI.
LPTSTR string // ANSI or Unicode string
);
Parameters
string
Pointer to the string to be interpreted as either Unicode or ANSI.
#ifdef UNICODE
#define __TEXT(quote) L##quote
#else /* UNICODE */
#define __TEXT(quote) quote
#endif /* UNICODE */
#define TEXT(quote) __TEXT(quote)
很明显,如果程序支持UNICODE则 则相当于 TEXT("haha") = L"haha" 宽字符版
否则 就是 TEXT("haha") = "haha"