登 录
在写一些程序的时候,需要获得当前应用程序的目录,那么可以用下面的方法获得:
CString XmlParser::GetAppPath() { TCHAR modulePath[MAX_PATH]; GetModuleFileName(NULL,modulePath,MAX_PATH); CString strModulePath(modulePath); strModulePath=strModulePath.Left(strModulePath.ReverseFind(L'//')); strModulePath.Append(L"//catalog.xml"); return strModulePath; }
抱歉!评论已关闭.