//当前程序目录创建samplingdata文件夹
char pFolderpath[MAX_PATH];
//得到当前路径
TCHAR tchBuffer[MAX_PATH ];
LPTSTR lpszCurDir;
lpszCurDir = tchBuffer;
GetCurrentDirectory(MAX_PATH , lpszCurDir);
// MessageBox(lpszCurDir);
CString CurPath = lpszCurDir;
CString FolderPath = CurPath + "\\SamplingData" ;
for(int i=0;i<FolderPath.GetLength();i++)
{
pFolderpath[i] = FolderPath.GetAt(i);
}
pFolderpath[i] = '\0';//路径结尾
DWORD dwAttr=GetFileAttributes(pFolderpath);
//若文件夹不存在,创建文件夹
if(dwAttr==0xFFFFFFFF)
{
CreateDirectory(pFolderpath,NULL);
}