Back to index

lightning-sunbird  0.9+nobinonly
IEPatcher.cpp
Go to the documentation of this file.
00001 // IEPatcher.cpp : Defines the class behaviors for the application.
00002 //
00003 
00004 #include "stdafx.h"
00005 #include "IEPatcher.h"
00006 
00007 #ifdef _DEBUG
00008 #define new DEBUG_NEW
00009 #undef THIS_FILE
00010 static char THIS_FILE[] = __FILE__;
00011 #endif
00012 
00014 // CIEPatcherApp
00015 
00016 BEGIN_MESSAGE_MAP(CIEPatcherApp, CWinApp)
00017        //{{AFX_MSG_MAP(CIEPatcherApp)
00018               // NOTE - the ClassWizard will add and remove mapping macros here.
00019               //    DO NOT EDIT what you see in these blocks of generated code!
00020        //}}AFX_MSG
00021        ON_COMMAND(ID_HELP, CWinApp::OnHelp)
00022 END_MESSAGE_MAP()
00023 
00025 // CIEPatcherApp construction
00026 
00027 CIEPatcherApp::CIEPatcherApp()
00028 {
00029        m_pIEPatcherDlg = NULL;
00030 }
00031 
00033 // The one and only CIEPatcherApp object
00034 
00035 CIEPatcherApp theApp;
00036 
00038 // CIEPatcherApp initialization
00039 
00040 BOOL CIEPatcherApp::InitInstance()
00041 {
00042        // Initialize OLE libraries
00043        if (!AfxOleInit())
00044        {
00045               AfxMessageBox(IDP_OLE_INIT_FAILED);
00046               return FALSE;
00047        }
00048 
00049        // Standard initialization
00050        // If you are not using these features and wish to reduce the size
00051        //  of your final executable, you should remove from the following
00052        //  the specific initialization routines you do not need.
00053 
00054 #ifdef _AFXDLL
00055        Enable3dControls();                // Call this when using MFC in a shared DLL
00056 #else
00057        Enable3dControlsStatic();   // Call this when linking to MFC statically
00058 #endif
00059 
00060        // Parse the command line to see if launched as OLE server
00061        if (RunEmbedded() || RunAutomated())
00062        {
00063               // Register all OLE server (factories) as running.  This enables the
00064               //  OLE libraries to create objects from other applications.
00065               COleTemplateServer::RegisterAll();
00066        }
00067        else
00068        {
00069               // When a server application is launched stand-alone, it is a good idea
00070               //  to update the system registry in case it has been damaged.
00071               COleObjectFactory::UpdateRegistryAll();
00072        }
00073 
00074        // Now the scanner window
00075        m_pIEPatcherDlg = new CIEPatcherDlg;
00076        m_pMainWnd = m_pIEPatcherDlg;
00077        int nResponse = m_pIEPatcherDlg->DoModal();
00078        if (nResponse == IDOK)
00079        {
00080               // TODO: Place code here to handle when the dialog is
00081               //  dismissed with OK
00082        }
00083        else if (nResponse == IDCANCEL)
00084        {
00085               // TODO: Place code here to handle when the dialog is
00086               //  dismissed with Cancel
00087        }
00088        delete m_pIEPatcherDlg;
00089 
00090        // Since the dialog has been closed, return FALSE so that we exit the
00091        //  application, rather than start the application's message pump.
00092        return FALSE;
00093 }