我没有弄明白你的问题,你用系统文件对话框打开一个文件,难道得不到该文件的路径吗,那你是如何打开的.系统文件对话框,是不是CFileDialog,如果是,使用:CString GetPathName( ) const;就可以得到文件路径.

解决方案 »

  1.   

    不管在文档或视图下,都是一样,如果你定义一个文件路径变量在文档下,则使用视图的CDocument* GetDocument( ) const;就可以得到文档的句柄,通过该句柄就可以得到文件路径变量.
      

  2.   

    CDocument *pDoc =pView->GetDocument();
    CString strFullPath = pDoc->GetPathName()if you file has been saved to disk or it's opened from disk.
      

  3.   

    谢谢大家!其实我不知道的是CDocument *pDoc =this->GetDocument();这个方法。