GetModuleFileName(NULL,csExeFilePath,MAX_PATH);

解决方案 »

  1.   

    AfxGetInstanceHandle可以得到当前进程的全路径名(含文件名),你把最后一个'\'后面的内容(也就是文件名啦)就可以得到当前程序的路径
      

  2.   

    GetcurrentDirectory() 可以的!
      

  3.   

    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
    );
    怎么会得不到?用下面的代码:
       char cPath[200];
       ::GetCurrentDirectory(200,cPath);
       AfxMessageBox(cPath);//通过对话框,看看是不是。