我是菜鸟,请详细一点,最好有代码说明。

解决方案 »

  1.   

    DWORD GetCurrentDirectory(DWORD nBufferLength,LPTSTR lpBuffer)
      

  2.   

    char path[1024];
    GetModuleFileName(
      NULL,    // handle to module
      path,  // file name of module
      1024);       // size of buffer
      

  3.   

    sPath.ReleaseBuffer ();
    int nPos;
    nPos=sPath.ReverseFind ('\\');
    sPath=sPath.Left (nPos);
      

  4.   

    CString sPath;
    GetModuleFileName(NULL,sPath.GetBufferSetLength(MAX_PATH+1),MAX_PATH);
    sPath.ReleaseBuffer ();
    int nPos;
    nPos=sPath.ReverseFind ('\\');
    sPath=sPath.Left (nPos);
      

  5.   

    能不能给个例子。
    如:
    CString aa;
    怎样把当前执行程序的路径付给它。
      

  6.   

    CString strPath = AfxGetAppName();
    int nPos = strPath.ReverseFind('\\');
    strPath.SetAt(nPos, 0x00);CString aa = strPath;