// MFC ApplicationDoc.cpp : implementation of the CMFCApplicationDoc class // #include "stdafx.h" #include "MFC Application.h" #include "MFC ApplicationDoc.hpp" #include "CntrItem.hpp" #include "SrvrItem.hpp" #ifdef _DEBUG #define new DEBUG_NEW #endif // CMFCApplicationDoc IMPLEMENT_DYNCREATE(CMFCApplicationDoc, COleServerDoc) BEGIN_MESSAGE_MAP(CMFCApplicationDoc, COleServerDoc) // Enable default OLE container implementation ON_UPDATE_COMMAND_UI(ID_EDIT_PASTE, COleServerDoc::OnUpdatePasteMenu) ON_UPDATE_COMMAND_UI(ID_EDIT_PASTE_LINK, COleServerDoc::OnUpdatePasteLinkMenu) ON_UPDATE_COMMAND_UI(ID_OLE_EDIT_CONVERT, COleServerDoc::OnUpdateObjectVerbMenu) ON_COMMAND(ID_OLE_EDIT_CONVERT, COleServerDoc::OnEditConvert) ON_UPDATE_COMMAND_UI(ID_OLE_EDIT_LINKS, COleServerDoc::OnUpdateEditLinksMenu) ON_COMMAND(ID_OLE_EDIT_LINKS, COleServerDoc::OnEditLinks) ON_UPDATE_COMMAND_UI_RANGE(ID_OLE_VERB_FIRST, ID_OLE_VERB_LAST, COleServerDoc::OnUpdateObjectVerbMenu) END_MESSAGE_MAP() // CMFCApplicationDoc construction/destruction CMFCApplicationDoc::CMFCApplicationDoc() { // Use OLE compound files EnableCompoundFile(); // TODO: add one-time construction code here } CMFCApplicationDoc::~CMFCApplicationDoc() { } BOOL CMFCApplicationDoc::OnNewDocument() { if (!COleServerDoc::OnNewDocument()) return FALSE; // TODO: add reinitialization code here // (SDI documents will reuse this document) return TRUE; } // CMFCApplicationDoc server implementation COleServerItem* CMFCApplicationDoc::OnGetEmbeddedItem() { // OnGetEmbeddedItem is called by the framework to get the COleServerItem // that is associated with the document. It is only called when necessary. CMFCApplicationSrvrItem* pItem = new CMFCApplicationSrvrItem(this); ASSERT_VALID(pItem); return pItem; } // CMFCApplicationDoc serialization void CMFCApplicationDoc::Serialize(CArchive& ar) { if (ar.IsStoring()) { // TODO: add storing code here } else { // TODO: add loading code here } // Calling the base class COleServerDoc enables serialization // of the container document's COleClientItem objects. COleServerDoc::Serialize(ar); } // CMFCApplicationDoc diagnostics #ifdef _DEBUG void CMFCApplicationDoc::AssertValid() const { COleServerDoc::AssertValid(); } void CMFCApplicationDoc::Dump(CDumpContext& dc) const { COleServerDoc::Dump(dc); } #endif //_DEBUG // CMFCApplicationDoc commands