Fix compilation of MFC support code in MSVS conformance mode
Allow the code to be compilable with /permissive-, which is on by default in VS2017. Closes https://github.com/wxWidgets/wxWidgets/pull/1263
This commit is contained in:
@@ -66,7 +66,7 @@ public:
|
|||||||
if ( !BaseApp::InitInstance() )
|
if ( !BaseApp::InitInstance() )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if ( !wxEntryStart(m_hInstance) )
|
if ( !wxEntryStart(BaseApp::m_hInstance) )
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if ( !wxTheApp || !wxTheApp->CallOnInit() )
|
if ( !wxTheApp || !wxTheApp->CallOnInit() )
|
||||||
@@ -80,8 +80,8 @@ public:
|
|||||||
|
|
||||||
int ExitInstance() wxOVERRIDE
|
int ExitInstance() wxOVERRIDE
|
||||||
{
|
{
|
||||||
delete m_pMainWnd;
|
delete BaseApp::m_pMainWnd;
|
||||||
m_pMainWnd = NULL;
|
BaseApp::m_pMainWnd = NULL;
|
||||||
|
|
||||||
if ( wxTheApp )
|
if ( wxTheApp )
|
||||||
wxTheApp->OnExit();
|
wxTheApp->OnExit();
|
||||||
@@ -137,7 +137,7 @@ protected:
|
|||||||
|
|
||||||
// We need to initialize the main window to let the program continue
|
// We need to initialize the main window to let the program continue
|
||||||
// running.
|
// running.
|
||||||
m_pMainWnd = new wxMFCWnd(w);
|
BaseApp::m_pMainWnd = new wxMFCWnd(w);
|
||||||
|
|
||||||
// We also need to reset m_pMainWnd when this window will be destroyed
|
// We also need to reset m_pMainWnd when this window will be destroyed
|
||||||
// to prevent MFC from using an invalid HWND, which is probably not
|
// to prevent MFC from using an invalid HWND, which is probably not
|
||||||
@@ -157,8 +157,8 @@ private:
|
|||||||
{
|
{
|
||||||
event.Skip();
|
event.Skip();
|
||||||
|
|
||||||
delete m_pMainWnd;
|
delete BaseApp::m_pMainWnd;
|
||||||
m_pMainWnd = NULL;
|
BaseApp::m_pMainWnd = NULL;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user