TCHAR szFilePath[MAX_PATH + 1]={0};
GetModuleFileName(NULL, szFilePath, MAX_PATH);
(_tcsrchr(szFilePath, _T('\\')))[1] = 0;//删除文件名,只获得路径字串
CString str_url = szFilePath; // 例如str_url==e:\program\Debug\ ==
str_url += "Log";
CString str_folder = _T("md ");
str_folder += str_url;
system((LPSTR)(LPCTSTR)str_folder);//创建一个文件夹
char folderPath[256];
int sizePath = (str_folder.GetLength() + 1)*sizeof(TCHAR);
TCHAR pName[200];
memcpy( pName, (LPCTSTR)str_folder, sizePath );
size_t i;
std::string curLocale = setlocale(LC_ALL, NULL);
setlocale(LC_ALL, "chs");
wcstombs_s(&i, folderPath, (size_t)200, pName, sizePath );
setlocale(LC_ALL, curLocale.c_str());
system(folderPath);