char temp[10];
strcpy(temp, "中国");
请问如何把temp转换成调用_T("中国")一样的效果?
strcpy(temp, "中国");
请问如何把temp转换成调用_T("中国")一样的效果?
解决方案 »
- 有没有好的P2P软件开发的社区?
- 怎么实现MFC中的弹出窗口和浮动窗口???
- vs2010 启动错误 the operation could not be...
- vs2008编译filezilla时缺libgnutls,libidn.lib库
- atl怎么样调用可执行文件并传递参数
- vc时间转化问题!
- 请问:directx9.0还继续支持directdraw吗?
- CRecordset.open一个超长的sql出错
- 如何把float转成CString
- 通过控件ID调用成员函数 和 通过绑定变量调用成员函数
- 我有linux2.4源码,谁要??
- 请问:如何将一个CStringList对象转化为char[],通过tcp/ip传输之后再还原为原来的CStringList
CString s;
s.Format("%s",temp);then s == _T("中国");
#define UNICODE#include <tchar.h>#include <windows.h>
TCHAR temp[10];
lstrcpy(temp, _T("中国"));
//#define UNICODE#include <tchar.h>#include <windows.h>
TCHAR temp[10];
lstrcpy(temp, _T("中国"));
MultiByteToWideChar//假定曾有下面的声明
char UserName[256];
WCHAR wszUserName[256];
//......
//......MultiByteToWideChar( CP_ACP, 0, UserName,strlen(UserName)+1, wszUserName, sizeof(wszUserName)/sizeof(wszUserName[0]) );