From 9f4905aeef55deec61401fed0c41d531a590e9b9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 15 Dec 2007 02:30:48 +0000 Subject: [PATCH] compilation fix + comment about bogus memory leak (patch 1849988) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50707 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/mfc/mfctest.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/samples/mfc/mfctest.cpp b/samples/mfc/mfctest.cpp index d0c92194ab..18b91e3647 100644 --- a/samples/mfc/mfctest.cpp +++ b/samples/mfc/mfctest.cpp @@ -38,8 +38,17 @@ // // nmake -f makefile.vc BUILD=debug SHARED=0 DEBUG_RUNTIME_LIBS=0 RUNTIME_LIBS=static all // -// Unless the run-time library settings match for wxWidgets and MFC, you will get -// link errors for symbols such as __mbctype, __argc, and __argv +// Unless the run-time library settings match for wxWidgets and MFC, you +// will get link errors for symbols such as __mbctype, __argc, and __argv +// +// (3) If you see bogus memory leaks within the MSVC IDE on exit, in this +// sample or in your own project, you must be using __WXDEBUG__ + +// WXUSINGDLL + _AFXDLL +// Unfortunately this confuses the MSVC/MFC leak detector. To do away with +// these bogus memory leaks, add this to the list of link objects, make it +// first: mfc[version][u]d.lib +// - [version] -> 42 or 70 or 80 etc +// - u if using Unicode #include "stdafx.h" @@ -214,7 +223,8 @@ int CTheApp::ExitInstance() // Override this to provide wxWidgets message loop compatibility BOOL CTheApp::PreTranslateMessage(MSG *msg) { - wxEventLoop *evtLoop = wxEventLoop::GetActive(); + wxEventLoop * const + evtLoop = wx_static_cast(wxEventLoop *, wxEventLoop::GetActive()); if ( evtLoop && evtLoop->PreProcessMessage(msg) ) return TRUE; -- 2.45.2