📄 ezwpdoc.cpp
字号:
// ezwpDoc.cpp : implementation of the CEzwpDoc class
//
#include "stdafx.h"
#include "ezwp.h"
#include "ezwpDoc.h"
#include "CntrItem.h"
#include "SrvrItem.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CEzwpDoc
IMPLEMENT_DYNCREATE(CEzwpDoc, CRichEditDoc)
BEGIN_MESSAGE_MAP(CEzwpDoc, CRichEditDoc)
//{{AFX_MSG_MAP(CEzwpDoc)
//}}AFX_MSG_MAP
// Enable default OLE container implementation
ON_UPDATE_COMMAND_UI(ID_OLE_EDIT_LINKS, CRichEditDoc::OnUpdateEditLinksMenu)
ON_COMMAND(ID_OLE_EDIT_LINKS, CRichEditDoc::OnEditLinks)
ON_UPDATE_COMMAND_UI(ID_OLE_VERB_FIRST, CRichEditDoc::OnUpdateObjectVerbMenu)
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(CEzwpDoc, CRichEditDoc)
//{{AFX_DISPATCH_MAP(CEzwpDoc)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
// Note: we add support for IID_IEzwp to support typesafe binding
// from VBA. This IID must match the GUID that is attached to the
// dispinterface in the .ODL file.
// {2DE517C2-346A-11CF-A7B2-444553540000}
static const IID IID_IEzwp =
{ 0x2de517c2, 0x346a, 0x11cf, { 0xa7, 0xb2, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0 } };
BEGIN_INTERFACE_MAP(CEzwpDoc, CRichEditDoc)
INTERFACE_PART(CEzwpDoc, IID_IEzwp, Dispatch)
END_INTERFACE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CEzwpDoc construction/destruction
CEzwpDoc::CEzwpDoc()
{
// Use OLE compound files
EnableCompoundFile();
// TODO: add one-time construction code here
EnableAutomation();
AfxOleLockApp();
}
CEzwpDoc::~CEzwpDoc()
{
AfxOleUnlockApp();
}
BOOL CEzwpDoc::OnNewDocument()
{
if (!CRichEditDoc::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
CRichEditCntrItem* CEzwpDoc::CreateClientItem(REOBJECT* preo) const
{
// cast away constness of this
return new CEzwpCntrItem(preo, (CEzwpDoc*) this);
}
/////////////////////////////////////////////////////////////////////////////
// CEzwpDoc server implementation
COleServerItem* CEzwpDoc::OnGetEmbeddedItem()
{
// OnGetEmbeddedItem is called by the framework to get the COleServerItem
// that is associated with the document. It is only called when necessary.
CEzwpSrvrItem* pItem = new CEzwpSrvrItem(this);
ASSERT_VALID(pItem);
return pItem;
}
/////////////////////////////////////////////////////////////////////////////
// CEzwpDoc serialization
void CEzwpDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
// Calling the base class CRichEditDoc enables serialization
// of the container document's COleClientItem objects.
CRichEditDoc::Serialize(ar);
}
/////////////////////////////////////////////////////////////////////////////
// CEzwpDoc diagnostics
#ifdef _DEBUG
void CEzwpDoc::AssertValid() const
{
CRichEditDoc::AssertValid();
}
void CEzwpDoc::Dump(CDumpContext& dc) const
{
CRichEditDoc::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CEzwpDoc commands
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -