www.pudn.com > FindMails.rar > DlgProxy.cpp
// DlgProxy.cpp : implementation file
//
#include "stdafx.h"
#include "FindEmail.h"
#include "DlgProxy.h"
#include "FindEmailDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFindEmailDlgAutoProxy
IMPLEMENT_DYNCREATE(CFindEmailDlgAutoProxy, CCmdTarget)
CFindEmailDlgAutoProxy::CFindEmailDlgAutoProxy()
{
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(CFindEmailDlg, AfxGetApp()->m_pMainWnd);
m_pDialog = (CFindEmailDlg*) AfxGetApp()->m_pMainWnd;
m_pDialog->m_pAutoProxy = this;
}
CFindEmailDlgAutoProxy::~CFindEmailDlgAutoProxy()
{
// 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 CFindEmailDlgAutoProxy::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(CFindEmailDlgAutoProxy, CCmdTarget)
//{{AFX_MSG_MAP(CFindEmailDlgAutoProxy)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(CFindEmailDlgAutoProxy, CCmdTarget)
//{{AFX_DISPATCH_MAP(CFindEmailDlgAutoProxy)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
// Note: we add support for IID_IFindEmail to support typesafe binding
// from VBA. This IID must match the GUID that is attached to the
// dispinterface in the .ODL file.
// {AC16CF84-7F22-11D6-A9C1-00E04C5E431C}
static const IID IID_IFindEmail =
{ 0xac16cf84, 0x7f22, 0x11d6, { 0xa9, 0xc1, 0x0, 0xe0, 0x4c, 0x5e, 0x43, 0x1c } };
BEGIN_INTERFACE_MAP(CFindEmailDlgAutoProxy, CCmdTarget)
INTERFACE_PART(CFindEmailDlgAutoProxy, IID_IFindEmail, Dispatch)
END_INTERFACE_MAP()
// The IMPLEMENT_OLECREATE2 macro is defined in StdAfx.h of this project
// {AC16CF82-7F22-11D6-A9C1-00E04C5E431C}
IMPLEMENT_OLECREATE2(CFindEmailDlgAutoProxy, "FindEmail.Application", 0xac16cf82, 0x7f22, 0x11d6, 0xa9, 0xc1, 0x0, 0xe0, 0x4c, 0x5e, 0x43, 0x1c)
/////////////////////////////////////////////////////////////////////////////
// CFindEmailDlgAutoProxy message handlers