CString转char*

来源:互联网 发布:出纳面试题知乎 编辑:程序博客网 时间:2024/06/08 05:21

这个真是醉了,,unicode下只有一种方式,其余的方法试过了都不行。。

    int len = WideCharToMultiByte(CP_ACP, 0, SendString, -1, NULL, 0, NULL, NULL);//其中的SendString是CString类型,csend是我想转换的char*类型    char* csend = new char[len + 1];    WideCharToMultiByte(CP_ACP, 0, SendString, -1, csend, len, NULL, NULL);
0 0