获取当前EXE执行路径

inline string GetModulePath()
{ 
	TCHAR szPath[MAX_PATH];
	if (GetModuleFileName(NULL, szPath, MAX_PATH))
	{
		PathRemoveFileSpec(szPath);
	}
	else
	{
		//异常处理
	}

	return szPath;
}
string strPath = GetModulePath().append("\\C6Sys.ini");
 if (!PathFileExists(strPath.c_str()))
 {
  return false;
 }



你可能感兴趣的:(获取当前EXE执行路径)