TCHAR
来源:互联网 发布:java命令行输入参数 编辑:程序博客网 时间:2024/04/30 06:55
The TCHAR data type is a Win32 character string that can be used to describe ANSI, DBCS, or Unicode strings. For ANSI and DBCS platforms, TCHAR is defined as follows:
typedef char TCHAR;
For Unicode platforms, TCHAR is defined as synonymous with the WCHAR type.
即,
TCHAR 在ANSI,DBCS 中是 char
TCHAR 在Unicode 中是 unsigned short
这在预编译中的UNICODE宏确定
#ifdefine UNICODE
define TCHAR WCHAR
#else
define TCHAR char
#char 转换成TCHAR?
使用预编译符
char szText[50]="程序员";
#ifdef _UNICODE
//此时TCHAR表示wchar,做相应转换即可
int i=0;
TCHAR szWideChar[50];
szWideChar[0]=0;
i=MultiByteToWideChar(CP_ACP,0,szText,-1,szWideChar,0);
i=MultiByteToWideChar(CP_ACP,0,szText,-1,szWideChar,i);
#else
//此时TCHAR表示char,不必做任何转换
#endif
- TCHAR
- TCHAR
- TCHAR
- TCHAR
- TCHAR
- TCHAR
- TCHAR
- TCHAR
- TCHAR
- TCHAR
- DLL TCHAR
- Tchar.h
- Tchar.h
- 关于TCHAR
- tchar.h
- TCHAR数组
- tchar函数
- TCHAR用法
- Tomcat配置技巧
- 序列模式分析算法GSP的实现
- 感受Windows XP中DOS命令的新增功能
- ajax入门小例子以及一些xmlhttp的参考资料
- java连接数据库出错啊!请大家帮帮忙啊!!!
- TCHAR
- Windows系统中鲜为人知的宝藏之程序篇
- 微软高级开发者管理峰会演讲摘要:产品质量的基石
- 图像文件相关操作
- 20050923Working Diary-- user defined message in Openh323
- 纯资源链接库(位图)
- 产品开发模式管理网站开发
- XP sp2的安全限制导致Adobe SVG Viewer无法使用浏览器脚本引擎?
- ThreadLocal的设计与使用