Back to index

lightning-sunbird  0.9+nobinonly
DlgProxy.cpp
Go to the documentation of this file.
00001 // DlgProxy.cpp : implementation file
00002 //
00003 
00004 #include "stdafx.h"
00005 #include "IEPatcher.h"
00006 #include "DlgProxy.h"
00007 #include "IEPatcherDlg.h"
00008 
00009 #ifdef _DEBUG
00010 #define new DEBUG_NEW
00011 #undef THIS_FILE
00012 static char THIS_FILE[] = __FILE__;
00013 #endif
00014 
00016 // CIEPatcherDlgAutoProxy
00017 
00018 IMPLEMENT_DYNCREATE(CIEPatcherDlgAutoProxy, CCmdTarget)
00019 
00020 CIEPatcherDlgAutoProxy::CIEPatcherDlgAutoProxy()
00021 {
00022        EnableAutomation();
00023        
00024        // To keep the application running as long as an OLE automation 
00025        //     object is active, the constructor calls AfxOleLockApp.
00026        AfxOleLockApp();
00027 
00028        // Get access to the dialog through the application's
00029        //  main window pointer.  Set the proxy's internal pointer
00030        //  to point to the dialog, and set the dialog's back pointer to
00031        //  this proxy.
00032        ASSERT (AfxGetApp()->m_pMainWnd != NULL);
00033        ASSERT_VALID (AfxGetApp()->m_pMainWnd);
00034        ASSERT_KINDOF(CIEPatcherDlg, AfxGetApp()->m_pMainWnd);
00035        m_pDialog = (CIEPatcherDlg*) AfxGetApp()->m_pMainWnd;
00036        m_pDialog->m_pAutoProxy = this;
00037 }
00038 
00039 CIEPatcherDlgAutoProxy::~CIEPatcherDlgAutoProxy()
00040 {
00041        // To terminate the application when all objects created with
00042        //     with OLE automation, the destructor calls AfxOleUnlockApp.
00043        //  Among other things, this will destroy the main dialog
00044        AfxOleUnlockApp();
00045 }
00046 
00047 void CIEPatcherDlgAutoProxy::OnFinalRelease()
00048 {
00049        // When the last reference for an automation object is released
00050        // OnFinalRelease is called.  The base class will automatically
00051        // deletes the object.  Add additional cleanup required for your
00052        // object before calling the base class.
00053 
00054        CCmdTarget::OnFinalRelease();
00055 }
00056 
00057 BEGIN_MESSAGE_MAP(CIEPatcherDlgAutoProxy, CCmdTarget)
00058        //{{AFX_MSG_MAP(CIEPatcherDlgAutoProxy)
00059               // NOTE - the ClassWizard will add and remove mapping macros here.
00060        //}}AFX_MSG_MAP
00061 END_MESSAGE_MAP()
00062 
00063 BEGIN_DISPATCH_MAP(CIEPatcherDlgAutoProxy, CCmdTarget)
00064        //{{AFX_DISPATCH_MAP(CIEPatcherDlgAutoProxy)
00065               // NOTE - the ClassWizard will add and remove mapping macros here.
00066        //}}AFX_DISPATCH_MAP
00067 END_DISPATCH_MAP()
00068 
00069 // Note: we add support for IID_IIEPatcher to support typesafe binding
00070 //  from VBA.  This IID must match the GUID that is attached to the 
00071 //  dispinterface in the .ODL file.
00072 
00073 // {A6031677-3B36-11D2-B44D-00600819607E}
00074 static const IID IID_IIEPatcher =
00075 { 0xa6031677, 0x3b36, 0x11d2, { 0xb4, 0x4d, 0x0, 0x60, 0x8, 0x19, 0x60, 0x7e } };
00076 
00077 BEGIN_INTERFACE_MAP(CIEPatcherDlgAutoProxy, CCmdTarget)
00078        INTERFACE_PART(CIEPatcherDlgAutoProxy, IID_IIEPatcher, Dispatch)
00079 END_INTERFACE_MAP()
00080 
00081 // The IMPLEMENT_OLECREATE2 macro is defined in StdAfx.h of this project
00082 // {A6031675-3B36-11D2-B44D-00600819607E}
00083 IMPLEMENT_OLECREATE2(CIEPatcherDlgAutoProxy, "IEPatcher.Application", 0xa6031675, 0x3b36, 0x11d2, 0xb4, 0x4d, 0x0, 0x60, 0x8, 0x19, 0x60, 0x7e)
00084 
00086 // CIEPatcherDlgAutoProxy message handlers