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

📄 dlgproxy.cpp

📁 美国Solartron测量设备的演示程序,带数据库和图形显示功能
💻 CPP
字号:
// DlgProxy.cpp : implementation file
//

#include "stdafx.h"
#include "Demo.h"
#include "DlgProxy.h"
#include "DemoDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDemoDlgAutoProxy

IMPLEMENT_DYNCREATE(CDemoDlgAutoProxy, CCmdTarget)

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

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

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

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

// {99F76EAF-CD26-4C8A-909D-00C1CABBA893}
static const IID IID_IDemo =
{ 0x99f76eaf, 0xcd26, 0x4c8a, { 0x90, 0x9d, 0x0, 0xc1, 0xca, 0xbb, 0xa8, 0x93 } };

BEGIN_INTERFACE_MAP(CDemoDlgAutoProxy, CCmdTarget)
	INTERFACE_PART(CDemoDlgAutoProxy, IID_IDemo, Dispatch)
END_INTERFACE_MAP()

// The IMPLEMENT_OLECREATE2 macro is defined in StdAfx.h of this project
// {66C12F9F-C2F8-4DE8-B321-744897ECF0D7}
IMPLEMENT_OLECREATE2(CDemoDlgAutoProxy, "Demo.Application", 0x66c12f9f, 0xc2f8, 0x4de8, 0xb3, 0x21, 0x74, 0x48, 0x97, 0xec, 0xf0, 0xd7)

/////////////////////////////////////////////////////////////////////////////
// CDemoDlgAutoProxy message handlers

⌨️ 快捷键说明

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