CString str="哈哈哈哈哈";
const char* ch = (LPSTR)(LPCTSTR)str;
int len = MultiByteToWideChar(CP_ACP, 0, ch, -1, NULL, 0);
wchar_t* wch = new wchar_t[len];
MultiByteToWideChar(CP_ACP, 0, ch, -1, wch, len);
locale("chs");
这样就把CString str成功转换成const wchar_t*了,str中的汉字也不会出现乱码