同题!
解决方案 »
- 了解zigbee请进?
- VC6.0+Access莫名unhandled exception(kernel32.dll),急!
- Delphi中的array of single类型在VC中是什么?
- msdn上的例子,在vs2005中调不通
- CStatic控件的双击处理
- 工程中的代码有些不理解,谁帮我分析一下,关于服务的
- 在sdk编程中,直接将窗口句柄强类型转换成窗口指针来使用,大家觉得有问题吗?
- 已发布的.ocx控件如何加密不能让别人使用
- CWinThread::PostThreadMessage()失败?/
- VPN的开发问题,急!!!
- 高分请教,超级难题!!如何在弹出对话框(非模式)中创建一个水平滚动条和一个垂直滚动条,来控制对话框中一块矩形区域,如何作呀?
- 请教:很多软件都有时间限制,请问这个东西是怎么实现的(注册表?数据加密?)。谢谢!
_T 的應用之時為了程序的可移植性。
#define __T(x) x_T(x)=x?
_T 定義 UNICODE 字符串
_T 的應用之時為了程序的可移植性。
写程序时所有字符串都用_T定义,
程序定义了 #define UNICODE 则表示_T是UNICODE字符串;
程序没定义UNICODE则表示_T什么也不代表,_T字符串就是char字符串;
就是说为了编译不同的版本,可以在程序开头定义定义或不定义UNICODE得到不同的字符串
详细介绍见《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)
有_T时,如果编译的版本不是Unicode版本,则该宏将字符串转换为ANSI字符集;如果编译的是Unicode版本则将字符串转换为宽字符集.如果没有_T则所有的字符串都是ANSI字符集
#ifdef _UNICODE
#define _T(x) L##x
#else
#define _T(x) x
#endif