GetCurrentPath()

来源:互联网 发布:ubuntu sudo转root 编辑:程序博客网 时间:2024/06/08 03:44


CString GetCurrentPath()
{
TCHAR   exeFullPath[MAX_PATH];   
GetModuleFileName(NULL,exeFullPath,MAX_PATH);
CString csCurrentPath = exeFullPath;
int pos = csCurrentPath.Find(_T("\\"));
int totalpos;
while(pos != -1)
{
pos++;
totalpos = pos;
pos = csCurrentPath.Find(_T("\\"),pos);
}
csCurrentPath = csCurrentPath.Mid(0,totalpos);
return csCurrentPath;
}
0 0