CString 转换为char*

来源:互联网 发布:看电影视频软件 编辑:程序博客网 时间:2024/06/06 02:54
CCDataBaseDlg dlg1;
CString strPathname="E:/1.BMP";
  
 USES_CONVERSION; 
 LPCWSTR lpcwStr = A2CW((LPCSTR)strPathname);
DWORD dwNum =                           WideCharToMultiByte(CP_OEMCP,NULL,lpcwStr,-1,NULL,NULL,0,NULL);
 char *c = new char[dwNum];
  WideCharToMultiByte(CP_OEMCP,NULL,lpcwStr,-1,c,dwNum,0,NULL);
0 0