3 MFC Logging Example documentation
4 =================================
5 by Craig Rodrigues <crodrigu@bbn.com>
8 The example in this directory is a Microsoft Foundation Class (MFC)
9 example which illustrates how to write an ACE_Log_Msg_Callback which
10 can send debug output to the Microsoft debugger console.
12 This is very useful when debugging an MFC GUI-based application which
17 - Make sure that $ACE_ROOT/ace/acemfcd.lib is built before building this
18 example. Follow the instructions in $ACE_ROOT/ACE-INSTALL.html for building
19 ACE with Visual C++. Do a Batch Build of ACE, and make sure that you build
20 the target "ACE DLL - Win32 MFC Debug".
22 - We must call ACE::init() and ACE::fini() in the right places
23 otherwise we will get strange crashes and memory leaks
24 when invoking ACE_Log_Msg::instance().
25 A good place to invoke these methods is in the method which overrides
26 CWinApp::InitInstance().
27 In this example, we invoke these methods in CLog_Msg_MFCApp::InitInstance().
29 - We must set the ACE_Log_Msg singleton to use our callback with:
30 ACE_Log_Msg::instance()->msg_callback( &m_mfc_logger );
31 ACE_Log_Msg::instance()->set_flags( ACE_Log_Msg::MSG_CALLBACK );
33 This is also done in CLog_Msg_MFCApp::InitInstance().
38 Thanks to the following people who provided assistance on the ACE
40 Chris Hafey <chafey@stentor.com>
41 Don Hinton <dhinton@ieee.org>