X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/885ebd2b32ebe2113b2a2a0241614b0ea468b229..3f687275132427f4b9b0d9e0a3cbf7ff2fc3e330:/samples/mfc/mfctest.cpp diff --git a/samples/mfc/mfctest.cpp b/samples/mfc/mfctest.cpp index 552aa76500..a8729861ab 100644 --- a/samples/mfc/mfctest.cpp +++ b/samples/mfc/mfctest.cpp @@ -32,12 +32,14 @@ // normally this shouldn't be needed any longer, i.e. it works without // it for me (VZ) // -// (2) You should link with MFC DLL, not static libraries - -// suppress warning about WINVER not being defined from MFC -#ifndef WINVER -#define WINVER 0x7000 -#endif +// (2) You should link with MFC DLL, not static libraries: or, to use static +// run-time libraries, use this command for both building wxWidgets and +// the sample: +// +// 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 #include "stdafx.h" @@ -194,6 +196,10 @@ BOOL CTheApp::InitInstance() int CTheApp::ExitInstance() { +#if !START_WITH_MFC_WINDOW + delete m_pMainWnd; +#endif + if ( wxTheApp ) wxTheApp->OnExit(); wxEntryCleanup(); @@ -332,6 +338,8 @@ MyChild::MyChild(wxFrame *frame, const wxString& title, const wxPoint& pos, cons MyChild::~MyChild() { + if ( IsLastBeforeExit() ) + PostQuitMessage(0); } void MyChild::OnQuit(wxCommandEvent& WXUNUSED(event)) @@ -354,7 +362,7 @@ void MyChild::OnActivate(wxActivateEvent& event) // Dummy MFC window for specifying a valid main window to MFC, using // a wxWidgets HWND. -CDummyWindow::CDummyWindow(HWND hWnd):CWnd() +CDummyWindow::CDummyWindow(HWND hWnd) { Attach(hWnd); }