CString strPath;
::GetCurrentDirectory(MAX_PATH,strPath);

解决方案 »

  1.   

    char tmp[256];
    memset(tmp,0,256);
    GetCurrentDirectory(256,tmp);给分!!!!!
      

  2.   

    那我要是在程序中调用过SetCurrentDirectory()呢?
      

  3.   

    CString CGlobal::g_PathGetAppPath()
    {
    if(g_strAppPath.IsEmpty()){
    static TCHAR szBuf [_MAX_PATH];
    // µÃµ½µ±Ç°Ó¦ÓóÌÐò·¾¶
    if (GetModuleFileName(AfxGetInstanceHandle(), szBuf , _MAX_PATH)){
    ::PathRemoveFileSpec(szBuf );
    g_strAppPath=szBuf;
    }
    }
    return g_strAppPath;
    }
      

  4.   

    http://www.vckbase.com/bbs/prime/viewprime.asp?id=35
      

  5.   

    CString Path;
    char PathBuf[256]; GetModuleFileName(NULL,PathBuf,256);
    Path=PathBuf;
    Path.MakeReverse();
    n=Path.Find('\\');
    Path.Delete(0,n);
    Path.MakeReverse();
    不包含文件名的
      

  6.   

    char FilePath[500];
    int PathLen =::GetModuleFileName(NULL,FilePath,5000);