19,500
社区成员
发帖
与我相关
我的任务
分享
char sourse[50] ="123我wo我";
DWORD dwNum = MultiByteToWideChar (CP_ACP, 0, (char*)sourse, -1, NULL, 0);
TCHAR *pwText;
pwText = new TCHAR[dwNum];
MultiByteToWideChar (CP_ACP, 0,(char*) sourse, -1, pwText, dwNum);
MessageBox(pwText);
delete []pwText;
{
char sourse[50] ="123我wo我";
DWORD dwNum = MultiByteToWideChar (936, 0, (char*)sourse, -1, NULL, 0);
TCHAR *pwText;
pwText = new TCHAR[dwNum];
MultiByteToWideChar (936, 0,(char*) sourse, -1, pwText, dwNum);
MessageBox(pwText);
delete []pwText;
}
运行结果也是正确的,LZ 可以试试。