c++之Unicode下vs中CString 转char*

来源:互联网 发布:电脑软件消失 编辑:程序博客网 时间:2024/06/07 12:22

这里写图片描述
注释:
strSend为带转换的CString对象
c为转换后的char *

//Unicode条件下,CString转char*    DWORD dwNum = WideCharToMultiByte(CP_OEMCP, NULL, strSend, -1, NULL, NULL, 0, NULL);    char *c = new char[dwNum];    WideCharToMultiByte(CP_OEMCP, NULL, strSend, -1, c, dwNum, 0, NULL);
0 0
原创粉丝点击