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

📄 dlgproxy.cpp

📁 编程实例
💻 CPP
字号:
// DlgProxy.cpp : implementation file
//

#include "stdafx.h"
#include "MyConnTrans.h"
#include "DlgProxy.h"
#include "MyConnTransDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMyConnTransDlgAutoProxy

IMPLEMENT_DYNCREATE(CMyConnTransDlgAutoProxy, CCmdTarget)

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

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

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

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

// {07F21823-6E58-46A2-AE5F-047C14F89ED7}
static const IID IID_IMyConnTrans =
{ 0x7f21823, 0x6e58, 0x46a2, { 0xae, 0x5f, 0x4, 0x7c, 0x14, 0xf8, 0x9e, 0xd7 } };

BEGIN_INTERFACE_MAP(CMyConnTransDlgAutoProxy, CCmdTarget)
	INTERFACE_PART(CMyConnTransDlgAutoProxy, IID_IMyConnTrans, Dispatch)
END_INTERFACE_MAP()

// The IMPLEMENT_OLECREATE2 macro is defined in StdAfx.h of this project
// {E3EF10BC-4E4D-4F09-A0A8-98871227E07F}
IMPLEMENT_OLECREATE2(CMyConnTransDlgAutoProxy, "MyConnTrans.Application", 0xe3ef10bc, 0x4e4d, 0x4f09, 0xa0, 0xa8, 0x98, 0x87, 0x12, 0x27, 0xe0, 0x7f)

/////////////////////////////////////////////////////////////////////////////
// CMyConnTransDlgAutoProxy message handlers

⌨️ 快捷键说明

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