dlgproxy.cpp

来自「该程序功能:用JAVa实现的彩色五珠棋小游戏」· C++ 代码 · 共 89 行

CPP
89
字号
// DlgProxy.cpp : implementation file
//

#include "stdafx.h"
#include "FivePlus.h"
#include "DlgProxy.h"
#include "FivePlusDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CFivePlusDlgAutoProxy

IMPLEMENT_DYNCREATE(CFivePlusDlgAutoProxy, CCmdTarget)

CFivePlusDlgAutoProxy::CFivePlusDlgAutoProxy()
{
	EnableAutomation();
	
	// To keep the application running as long as an automation 
	//	object is active, the constructor calls AfxOleLockApp.
	AfxOleLockApp();

	// Get access to the dialog through the application's
	//  main window pointer.  Set the proxy's internal pointer
	//  to point to the dialog, and set the dialog's back pointer to
	//  this proxy.
	ASSERT (AfxGetApp()->m_pMainWnd != NULL);
	ASSERT_VALID (AfxGetApp()->m_pMainWnd);
	ASSERT_KINDOF(CFivePlusDlg, AfxGetApp()->m_pMainWnd);
	m_pDialog = (CFivePlusDlg*) AfxGetApp()->m_pMainWnd;
	m_pDialog->m_pAutoProxy = this;
}

CFivePlusDlgAutoProxy::~CFivePlusDlgAutoProxy()
{
	// To terminate the application when all objects created with
	// 	with automation, the destructor calls AfxOleUnlockApp.
	//  Among other things, this will destroy the main dialog
	if (m_pDialog != NULL)
		m_pDialog->m_pAutoProxy = NULL;
	AfxOleUnlockApp();
}

void CFivePlusDlgAutoProxy::OnFinalRelease()
{
	// When the last reference for an automation object is released
	// OnFinalRelease is called.  The base class will automatically
	// deletes the object.  Add additional cleanup required for your
	// object before calling the base class.

	CCmdTarget::OnFinalRelease();
}

BEGIN_MESSAGE_MAP(CFivePlusDlgAutoProxy, CCmdTarget)
	//{{AFX_MSG_MAP(CFivePlusDlgAutoProxy)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

BEGIN_DISPATCH_MAP(CFivePlusDlgAutoProxy, CCmdTarget)
	//{{AFX_DISPATCH_MAP(CFivePlusDlgAutoProxy)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()

// Note: we add support for IID_IFivePlus to support typesafe binding
//  from VBA.  This IID must match the GUID that is attached to the 
//  dispinterface in the .ODL file.

// {46760B8F-C226-4EFE-BA9B-AC947162BCBE}
static const IID IID_IFivePlus =
{ 0x46760b8f, 0xc226, 0x4efe, { 0xba, 0x9b, 0xac, 0x94, 0x71, 0x62, 0xbc, 0xbe } };

BEGIN_INTERFACE_MAP(CFivePlusDlgAutoProxy, CCmdTarget)
	INTERFACE_PART(CFivePlusDlgAutoProxy, IID_IFivePlus, Dispatch)
END_INTERFACE_MAP()

// The IMPLEMENT_OLECREATE2 macro is defined in StdAfx.h of this project
// {C4A2156C-F2BE-48EC-9601-A1940611FE49}
IMPLEMENT_OLECREATE2(CFivePlusDlgAutoProxy, "FivePlus.Application", 0xc4a2156c, 0xf2be, 0x48ec, 0x96, 0x1, 0xa1, 0x94, 0x6, 0x11, 0xfe, 0x49)

/////////////////////////////////////////////////////////////////////////////
// CFivePlusDlgAutoProxy message handlers

⌨️ 快捷键说明

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