1.//以下代码来自CSDN 2004 VC编程经验总结
{
CString strPath;
GetCurrentDirectory(MAX_PATH,strPath.GetBuffer(MAX_PATH));
strPath.ReleaseBuffer();
return strPath;
}
2.//以下代码来自TZ MFC.NET Primer 1.01
CString CPropertyGridSampleApp::GetCurrWorkingDir()
{
CString strPath;
TCHAR szFull[_MAX_PATH];
TCHAR szDrive[_MAX_DRIVE];
TCHAR szDir[_MAX_DIR];
::GetModuleFileName(NULL, szFull, sizeof(szFull)/sizeof(TCHAR));
_tsplitpath(szFull, szDrive, szDir, NULL, NULL);
_tcscpy(szFull, szDrive);
_tcscat(szFull, szDir);
strPath = CString(szFull);
return strPath;
}