⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dlgproxy.cpp

📁 这是一款用MFC ADO编写的数据库软件
💻 CPP
字号:
// DlgProxy.cpp : implementation file
//

#include "stdafx.h"
#include "数据库ADO.h"
#include "DlgProxy.h"
#include "数据库ADODlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CADODlgAutoProxy

IMPLEMENT_DYNCREATE(CADODlgAutoProxy, CCmdTarget)

CADODlgAutoProxy::CADODlgAutoProxy()
{
	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(CADODlg, AfxGetApp()->m_pMainWnd);
	m_pDialog = (CADODlg*) AfxGetApp()->m_pMainWnd;
	m_pDialog->m_pAutoProxy = this;
}

CADODlgAutoProxy::~CADODlgAutoProxy()
{
	// 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 CADODlgAutoProxy::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(CADODlgAutoProxy, CCmdTarget)
	//{{AFX_MSG_MAP(CADODlgAutoProxy)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

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

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

// {C2D7EA02-A57B-4BB0-A766-54F01D459F2E}
static const IID IID_IADO =
{ 0xc2d7ea02, 0xa57b, 0x4bb0, { 0xa7, 0x66, 0x54, 0xf0, 0x1d, 0x45, 0x9f, 0x2e } };

BEGIN_INTERFACE_MAP(CADODlgAutoProxy, CCmdTarget)
	INTERFACE_PART(CADODlgAutoProxy, IID_IADO, Dispatch)
END_INTERFACE_MAP()

// The IMPLEMENT_OLECREATE2 macro is defined in StdAfx.h of this project
// {10EE2C76-2856-47D0-899F-17FBA353713B}
IMPLEMENT_OLECREATE2(CADODlgAutoProxy, "ADO.Application", 0x10ee2c76, 0x2856, 0x47d0, 0x89, 0x9f, 0x17, 0xfb, 0xa3, 0x53, 0x71, 0x3b)

/////////////////////////////////////////////////////////////////////////////
// CADODlgAutoProxy message handlers

⌨️ 快捷键说明

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