同题!

解决方案 »

  1.   

    和_TEXT的含义一样,tchar.h定义的宏,用来说明定义的是一个unicode编码的字符串,不用就是传统的char8位字符。
      

  2.   

    如果定义了UNICODE,就转换为Unicode,否则不变。
      

  3.   

    _T 定義 UNICODE 字符串
    _T 的應用之時為了程序的可移植性。
      

  4.   

    #define  _T(x)      __T(x)
    #define __T(x)      x_T(x)=x?
      

  5.   

    基本和gull1234(俗不可耐)说的一样,
    _T 定義 UNICODE 字符串
    _T 的應用之時為了程序的可移植性。
    写程序时所有字符串都用_T定义,
    程序定义了 #define UNICODE 则表示_T是UNICODE字符串;
    程序没定义UNICODE则表示_T什么也不代表,_T字符串就是char字符串;
    就是说为了编译不同的版本,可以在程序开头定义定义或不定义UNICODE得到不同的字符串
      

  6.   

    同意。
    详细介绍见《Windows程序设计》P27
    英文电子内容如下If the _UNICODE identifier is defined, a macro called __T is defined like this: 
    #define __T(x) L##xThis is fairly obscure syntax, but it's in the ANSI C standard for the C preprocessor. That pair of number signs is called a "token paste," and it causes the letter L to be appended to the macro parameter. Thus, if the macro parameter is "Hello!", then L##x is L"Hello!". If the _UNICODE identifier is not defined, the __T macro is simply defined in the following way: 
    #define __T(x) xRegardless, two other macros are defined to be the same as __T: 
    #define _T(x) __T(x)
    #define _TEXT(x) __T(x)
      

  7.   

    当然有区别:
    有_T时,如果编译的版本不是Unicode版本,则该宏将字符串转换为ANSI字符集;如果编译的是Unicode版本则将字符串转换为宽字符集.如果没有_T则所有的字符串都是ANSI字符集
      

  8.   

    自己实现就是:
    #ifdef _UNICODE
    #define _T(x)       L##x
    #else
    #define _T(x)       x
    #endif