获取MFC中EXE的路径名
inline CString GetAppPath()
{
HMODULE hModule = GetModuleHandle(NULL);
ASSERT(hModule);
TCHAR tcPath[_MAX_PATH];
ZeroMemory(tcPath, sizeof(TCHAR) * _MAX_PATH);
DWORD dwRet = GetModuleFileName(hModule, tcPath, _MAX_PATH);
if(dwRet == 0)
return _T("");
CString strAppPath = tcPath;
int pos = strAppPath.ReverseFind(_T('\\'));
ASSERT(pos != -1);
int length = strAppPath.GetLength();
strAppPath.Delete(pos+1, length-(pos+1));
return strAppPath;
}

浙公网安备 33010602011771号