- CString GetSystemDir()
- {
- static bool bAlreadyGet = false;
- static CString strDir;
- TCHAR strSystemDir[MAX_PATH];
-
- if(!bAlreadyGet)
- {
- memset(strSystemDir, 0, MAX_PATH*sizeof(TCHAR));
- GetModuleFileName(NULL,strSystemDir,MAX_PATH-1);
-
- strDir=strSystemDir;
- strDir=strDir.Left(strDir.ReverseFind('\\'));
- bAlreadyGet = true;
- }
-
- return strDir;
- }
|