Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / examples / Log_Msg / Log_Msg_MFC / Log_Msg_MFC.cpp
blob26674905a25047dc11cb414714ab594d03ec9e47
1 // Log_Msg_MFC.cpp : Defines the class behaviors for the application.
2 #include "ace/Log_Msg.h"
3 #include "Log_Msg_MFC.h"
4 #include "ace/Init_ACE.h"
6 #if defined (ACE_WIN32)
8 #include "stdafx.h"
9 #include "Log_Msg_MFCDlg.h"
11 #ifdef _DEBUG
12 #define new DEBUG_NEW
13 #undef THIS_FILE
14 static char THIS_FILE[] = __FILE__;
15 #endif
17 #include <ace/ACE.h>
19 /////////////////////////////////////////////////////////////////////////////
20 // CLog_Msg_MFCApp
22 BEGIN_MESSAGE_MAP(CLog_Msg_MFCApp, CWinApp)
23 //{{AFX_MSG_MAP(CLog_Msg_MFCApp)
24 // NOTE - the ClassWizard will add and remove mapping macros here.
25 // DO NOT EDIT what you see in these blocks of generated code!
26 //}}AFX_MSG
27 ON_COMMAND(ID_HELP, CWinApp::OnHelp)
28 END_MESSAGE_MAP()
30 /////////////////////////////////////////////////////////////////////////////
31 // CLog_Msg_MFCApp construction
33 CLog_Msg_MFCApp::CLog_Msg_MFCApp()
35 // TODO: add construction code here,
36 // Place all significant initialization in InitInstance
39 /////////////////////////////////////////////////////////////////////////////
40 // The one and only CLog_Msg_MFCApp object
42 CLog_Msg_MFCApp theApp;
44 /////////////////////////////////////////////////////////////////////////////
45 // CLog_Msg_MFCApp initialization
47 BOOL CLog_Msg_MFCApp::InitInstance()
49 // Standard initialization
50 // If you are not using these features and wish to reduce the size
51 // of your final executable, you should remove from the following
52 // the specific initialization routines you do not need.
54 // Need to call ACE::init() before calling any functions in ACE.
55 // If we were writing a console based application, the ACE macros which
56 // re-define main() would automatically call this. However, since
57 // we are running inside an MFC application, we need to explicitly call this.
58 ACE::init();
60 // Call to set the ACE Log_Msg class here.
61 // From now on, whenever we use ACE_DEBUG macros, the output
62 // will be sent to the log() method of our MFC_Log class.
63 ACE_Log_Msg::instance()->msg_callback( &m_mfc_logger );
64 ACE_Log_Msg::instance()->set_flags( ACE_Log_Msg::MSG_CALLBACK );
66 CLog_Msg_MFCDlg dlg;
67 m_pMainWnd = &dlg;
68 int nResponse = dlg.DoModal();
69 if (nResponse == IDOK)
71 // TODO: Place code here to handle when the dialog is
72 // dismissed with OK
74 else if (nResponse == IDCANCEL)
76 // TODO: Place code here to handle when the dialog is
77 // dismissed with Cancel
80 // Since we called ACE::init(), we need to call ACE:fini(), otherwise
81 // the debugger will complain about memory leaks.
82 ACE::fini();
84 // Since the dialog has been closed, return FALSE so that we exit the
85 // application, rather than start the application's message pump.
86 return FALSE;
89 #endif /* ACE_WIN32 */