在一个对话框的ok函数里怎样得到当前打开文件的路径。

解决方案 »

  1.   

    The GetCurrentDirectory function retrieves the current directory for the current process
      

  2.   

    CFile::GetFilePath
    virtual CString GetFilePath( ) const;Return ValueThe full path of the specified file.ResCall this member function to retrieve the full path of a specified file. For example, when you call GetFilePath to generate a message to the user about the file c:\windows\write\myfile.wri, the file path, c:\windows\write\myfile.wri, is returned.To return just the name of the file (myfile.wri), call GetFileName. To return the title of the file (myfile), call GetFileTitle.
      

  3.   

    GetModuleFileName(Hwnd*,CString)
    API函数,很多编译程序都可调用