DWORD dwLen=WideCharToMultiByte(CP_ACP,0,ofn.lpstrFile,-1,NULL,0,NULL,NULL);
PSTR pMultiByteStr=new char[dwLen];
WideCharToMultiByte(CP_ACP,0,ofn.lpstrFile,-1,pMultiByteStr,dwLen,NULL,NULL);
delete []pMultiByteStr;
DWORD dwLen=WideCharToMultiByte(CP_ACP,0,ofn.lpstrFile,-1,NULL,0,NULL,NULL);
PSTR pMultiByteStr=new char[dwLen];
WideCharToMultiByte(CP_ACP,0,ofn.lpstrFile,-1,pMultiByteStr,dwLen,NULL,NULL);
delete []pMultiByteStr;
转载于:https://www.cnblogs.com/fromchaos/archive/2009/11/29/1613293.html