📄 dlgproxy.cpp
字号:
// DlgProxy.cpp : implementation file
//
#include "stdafx.h"
#include "BookLib.h"
#include "DlgProxy.h"
#include "BookLibDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CBookLibDlgAutoProxy
IMPLEMENT_DYNCREATE(CBookLibDlgAutoProxy, CCmdTarget)
CBookLibDlgAutoProxy::CBookLibDlgAutoProxy()
{
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(CBookLibDlg, AfxGetApp()->m_pMainWnd);
m_pDialog = (CBookLibDlg*) AfxGetApp()->m_pMainWnd;
m_pDialog->m_pAutoProxy = this;
}
CBookLibDlgAutoProxy::~CBookLibDlgAutoProxy()
{
// 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 CBookLibDlgAutoProxy::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(CBookLibDlgAutoProxy, CCmdTarget)
//{{AFX_MSG_MAP(CBookLibDlgAutoProxy)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(CBookLibDlgAutoProxy, CCmdTarget)
//{{AFX_DISPATCH_MAP(CBookLibDlgAutoProxy)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
// Note: we add support for IID_IBookLib to support typesafe binding
// from VBA. This IID must match the GUID that is attached to the
// dispinterface in the .ODL file.
// {01AF7B13-0FBB-4D78-A078-B9E13F2C7405}
static const IID IID_IBookLib =
{ 0x1af7b13, 0xfbb, 0x4d78, { 0xa0, 0x78, 0xb9, 0xe1, 0x3f, 0x2c, 0x74, 0x5 } };
BEGIN_INTERFACE_MAP(CBookLibDlgAutoProxy, CCmdTarget)
INTERFACE_PART(CBookLibDlgAutoProxy, IID_IBookLib, Dispatch)
END_INTERFACE_MAP()
// The IMPLEMENT_OLECREATE2 macro is defined in StdAfx.h of this project
// {1A04CFF3-10E8-4D72-A9A7-CB6FA906DE61}
IMPLEMENT_OLECREATE2(CBookLibDlgAutoProxy, "BookLib.Application", 0x1a04cff3, 0x10e8, 0x4d72, 0xa9, 0xa7, 0xcb, 0x6f, 0xa9, 0x6, 0xde, 0x61)
/////////////////////////////////////////////////////////////////////////////
// CBookLibDlgAutoProxy message handlers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -