TCHAR moduleFileName[260];
::GetModuleFileName(NULL,moduleFileName, 260);
(_tcsrchr(moduleFileName, _T('\\')))[1] = 0;
CString strPath = moduleFileName;
strPath.Append(_T("\\test"));//获取与exe运行文件位于一个目录下的test文件夹路径。
string test=CT2A(strPath);
::GetModuleFileName(NULL,moduleFileName, 260);
(_tcsrchr(moduleFileName, _T('\\')))[1] = 0;
CString strPath = moduleFileName;
strPath.Append(_T("\\test"));//获取与exe运行文件位于一个目录下的test文件夹路径。
string test=CT2A(strPath);
if (_access(test.c_str(),0)!=-1)
{
//file exist.
}