解决后马上解贴,谢谢!

解决方案 »

  1.   

    The GetCurrentDirectory function retrieves the current directory for the current process. DWORD GetCurrentDirectory(
      DWORD nBufferLength,  // size, in characters, of directory buffer
      LPTSTR lpBuffer       // pointer to buffer for current directory
    );
     
      

  2.   

    CString strCurrentDir;
    GetCurrentDirectory(255,strCurrentDir.GetBuffer(255));
    strCurrentDir.ReleaseBuffer();
      

  3.   

    // Get the path of the application
    char szFilename[MAX_PATH];
    DWORD dwPathLen = 0;
    if((dwPathLen = ::GetModuleFileName(
      ::AfxGetInstanceHandle(),
      szFilename,
      MAX_PATH
      )) == 0) 
     {
        // fail get the path
      }
      

  4.   

    char sz[MAX_PATH];
    ::GetCurrentDirectory(MAX_PATH,sz);
    CString FilePath=sz;