在stdafx.h中包含如下头文件:
#include <atlbase.h>
在函数体中添加以下测试例程:
USES_CONVERSION;
char p[2];
p[0]=0xc4;
p[1]=0xe3;//显示中文字"你"
LPWSTR pszText = A2W(p);
CString myStr;
myStr.Format(_T("%s"),pszText);
MessageBox(myStr);
在stdafx.h中包含如下头文件:
#include <atlbase.h>
在函数体中添加以下测试例程:
USES_CONVERSION;
char p[2];
p[0]=0xc4;
p[1]=0xe3;//显示中文字"你"
LPWSTR pszText = A2W(p);
CString myStr;
myStr.Format(_T("%s"),pszText);
MessageBox(myStr);