One, in front of the string with an L function: such as L "my string" means the ANSI string is converted to Unicode string, that is, each character occupies two bytes. Strlen ("ASD") = 3; Strlen (L "ASD") = 6;
The _t macro can enclose a quoted string, depending on your environment settings, so that the compiler chooses the appropriate (Unicode or ANSI) character processing based on the compiled target environment if you have defined Unicode, then the _t macro will precede the string with an L. At this point _t ("ABCD") is equivalent to L "ABCD", which is a wide string. If there is no definition, then the _t macro does not precede the string with that l,_t ("ABCD") equivalent to "ABCD"
Third, Text,_text and _t the same
such as the following three statements: TCHAR szstr1[] = TEXT ("str1"); Char szstr2[] = "STR2"; WCHAR szstr3[] = L ("Str3"); The first sentence, when defined as Unicode, is interpreted as a third sentence, which is equal to the second sentence when it is not defined. But two words whether or not Unicode is defined produces an ANSI string, and the third sentence always generates a Unicode string. For the portability of the program, it is recommended to use the first presentation method. However, in some cases, a character must be ANSI or Unicode, then use the latter two
http://blog.csdn.net/adcxf/article/details/2540992
The role of string-related macro _t, Text,_text, and L in VC (simple and straightforward)