📄 dlgproxy.cpp
字号:
// DlgProxy.cpp : implementation file
//
#include "stdafx.h"
#include "10.h"
#include "DlgProxy.h"
#include "10Dlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMy10DlgAutoProxy
IMPLEMENT_DYNCREATE(CMy10DlgAutoProxy, CCmdTarget)
CMy10DlgAutoProxy::CMy10DlgAutoProxy()
{
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(CMy10Dlg, AfxGetApp()->m_pMainWnd);
m_pDialog = (CMy10Dlg*) AfxGetApp()->m_pMainWnd;
m_pDialog->m_pAutoProxy = this;
}
CMy10DlgAutoProxy::~CMy10DlgAutoProxy()
{
// 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 CMy10DlgAutoProxy::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(CMy10DlgAutoProxy, CCmdTarget)
//{{AFX_MSG_MAP(CMy10DlgAutoProxy)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(CMy10DlgAutoProxy, CCmdTarget)
//{{AFX_DISPATCH_MAP(CMy10DlgAutoProxy)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
// Note: we add support for IID_IMy10 to support typesafe binding
// from VBA. This IID must match the GUID that is attached to the
// dispinterface in the .ODL file.
// {9B1F9F8D-0FA4-4D31-B0B4-087DE7DE78F0}
static const IID IID_IMy10 =
{ 0x9b1f9f8d, 0xfa4, 0x4d31, { 0xb0, 0xb4, 0x8, 0x7d, 0xe7, 0xde, 0x78, 0xf0 } };
BEGIN_INTERFACE_MAP(CMy10DlgAutoProxy, CCmdTarget)
INTERFACE_PART(CMy10DlgAutoProxy, IID_IMy10, Dispatch)
END_INTERFACE_MAP()
// The IMPLEMENT_OLECREATE2 macro is defined in StdAfx.h of this project
// {25EB9AD5-ABB4-4E2D-83B4-D182DAAAA3F9}
IMPLEMENT_OLECREATE2(CMy10DlgAutoProxy, "My10.Application", 0x25eb9ad5, 0xabb4, 0x4e2d, 0x83, 0xb4, 0xd1, 0x82, 0xda, 0xaa, 0xa3, 0xf9)
/////////////////////////////////////////////////////////////////////////////
// CMy10DlgAutoProxy message handlers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -