方法一:GetModuleFileName
CString stmp = "";
TCHAR exeFullPath[_MAX_PATH];
GetModuleFileName(NULL, exeFullPath, _MAX_PATH);
stmp = exeFullPath;
int n = stmp.ReverseFind('\\');
stmp = stmp.Mid(0, n);
strcpy(exeFullPath, stmp);
SetCurrentDirectory((LPTSTR)exeFullPath);
CString filedir = exeFullPath;
方法二:GetCurrentDirectory
CString strCurrentDir;
char cBuf[MAX_PATH];
GetCurrentDirectory(MAX_PATH, cBuf);
strcat(cBuf, strCurrentDir);
strCurrentDir = cBuf;