axatlcondoc.cpp

来自「教你怎么用VC++做ActiveX控件」· C++ 代码 · 共 108 行

CPP
108
字号
// AxAtlConDoc.cpp : implementation of the CAxAtlConDoc class
//

#include "stdafx.h"
#include "AxAtlCon.h"

#include "AxAtlConDoc.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CAxAtlConDoc

IMPLEMENT_DYNCREATE(CAxAtlConDoc, CDocument)

BEGIN_MESSAGE_MAP(CAxAtlConDoc, CDocument)
	//{{AFX_MSG_MAP(CAxAtlConDoc)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

BEGIN_DISPATCH_MAP(CAxAtlConDoc, CDocument)
	//{{AFX_DISPATCH_MAP(CAxAtlConDoc)
		// 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_IAxAtlCon to support typesafe binding
//  from VBA.  This IID must match the GUID that is attached to the 
//  dispinterface in the .ODL file.

// {E38E77C7-7DE3-11D4-A54D-0050BADB14A3}
static const IID IID_IAxAtlCon =
{ 0xe38e77c7, 0x7de3, 0x11d4, { 0xa5, 0x4d, 0x0, 0x50, 0xba, 0xdb, 0x14, 0xa3 } };

BEGIN_INTERFACE_MAP(CAxAtlConDoc, CDocument)
	INTERFACE_PART(CAxAtlConDoc, IID_IAxAtlCon, Dispatch)
END_INTERFACE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAxAtlConDoc construction/destruction

CAxAtlConDoc::CAxAtlConDoc()
{
	// TODO: add one-time construction code here

	EnableAutomation();

	AfxOleLockApp();
}

CAxAtlConDoc::~CAxAtlConDoc()
{
	AfxOleUnlockApp();
}

BOOL CAxAtlConDoc::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;

	// TODO: add reinitialization code here
	// (SDI documents will reuse this document)

	return TRUE;
}



/////////////////////////////////////////////////////////////////////////////
// CAxAtlConDoc serialization

void CAxAtlConDoc::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}

/////////////////////////////////////////////////////////////////////////////
// CAxAtlConDoc diagnostics

#ifdef _DEBUG
void CAxAtlConDoc::AssertValid() const
{
	CDocument::AssertValid();
}

void CAxAtlConDoc::Dump(CDumpContext& dc) const
{
	CDocument::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CAxAtlConDoc commands

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?