不重载OnFileOpen 得到文件路径
来源:百度知道 编辑:UC知道 时间:2024/06/08 10:06:45
网上查到说可以直接用lpszPathName就是当前文件的路径,我在View类里面用这个有错,“undeclared identifier”
先定义:CFileDialog 对象 fd
fd.GetPathName();
CDocument::GetPathName See Also
CDocument Overview | Class Members | Hierarchy Chart | CDocument::SetPathName
Call this function to get the fully qualified path of the document's disk file.
const CString& GetPathName( ) const;
Return Value
The document's fully qualified path. This string is empty if the document has not been saved or does not have a disk file associated with it.
-------------------------------------------
CDocument::GetTitle See Also
CDocument Overview | Class Members | Hierarchy Chart | CDocument::SetTitle
Call this function to get the document's title, which is usually derived from the document's filename.
const CString& GetTitle( ) const;
Return Value
The document's title.
--------------------------------
重载下面的函数
BOOL CEditviewDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
if (!CDocument