1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| TCHAR szPathName[MAX_PATH]; memset(szPathName, 0, MAX_PATH); if (0 == GetModuleFileName(NULL, szPathName, MAX_PATH)) { return _T(""); } CString rValue; rValue = szPathName; for (int i = rValue.GetLength(); i > 0; --i) { if ('\\' == rValue[i-1]) { rValue = rValue.Left(i); break; } } return rValue;
|