//eg: strPath = "D:\\file\\test\\1.txt" 递归检查并创建该路径中的文件夹
void createFolderForPath(const string& strPath)
{
string strFolder;
int iPos = strPath.find_last_of('\\');
if (iPos != -1)
{
strFolder = strPath.substr(0, iPos);
if (!PathIsDirectory(strFolder.c_str()))
{
createFolderForPath(strFolder);
::CreateDirectory(strFolder.c_str(), NULL);
}
}
}