#include "MetaFile.h"
class CLoadMetaFileDoc : public CDocument
{
...
// Implementation
public:
CMetaFile m_meta;
virtual ~CLoadMetaFileDoc();
...
};
BOOL CLoadMetaFileDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
if (!CDocument::OnOpenDocument(lpszPathName))
return FALSE;
// TODO: Add your specialized creation code here
// {
m_meta.Read(lpszPathName);
// }
return TRUE;
}
void CLoadMetaFileDoc::DeleteContents()
{
// TODO: Add your specialized code here and/or call the base class
// {
m_meta.Clear();
// }
CDocument::DeleteContents();
}
void CLoadMetaFileView::OnDraw(CDC* pDC)
{
CLoadMetaFileDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CRect rectClient;
GetClientRect(rectClient);
pDoc->m_meta.Display(pDC, rectClient);
}