工作总结:获取当前程序直接路径
代码:
CString GetConfDir()//获得路径 { CString sTemp; CString sCurrentDir = ""; char lpszCurrentDir[MERGE_MAX_SIZE_OF_DIR_SEARCH_BUFF]; ::GetModuleFileName( NULL, lpszCurrentDir, MERGE_MAX_SIZE_OF_DIR_SEARCH_BUFF); //Get current directory sCurrentDir = lpszCurrentDir; if (lpszCurrentDir[strlen(lpszCurrentDir) - 1] != '\\') { sCurrentDir = sCurrentDir.Left(sCurrentDir.ReverseFind('\\') + 1); } return sCurrentDir; }