怎样获得执行文件所在路径,用GetModuleFileName()获得是路径加文件名,有什么函数只获得路径呢
TCHAR szPath[MAX_PATH];
::GetModuleFileName(NULL,szPath,MAX_PATH);
CString strPath = szPath;
int index = strPath.ReverseFind(_T( '\\'));
strPath = strPath.Left(index + 1);
::GetModuleFileName(NULL,szPath,MAX_PATH);
CString strPath = szPath;
int index = strPath.ReverseFind(_T( '\\'));
strPath = strPath.Left(index + 1);