From b30ba481be1b58fb49daa3ba9a3bfd85e071fe2a Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Tue, 28 Mar 2000 09:29:14 +0000 Subject: [PATCH] Added an assert to dialog.cpp to make it clearer where the failure happened. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@6970 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/button.cpp | 7 +++++++ src/msw/dialog.cpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/msw/button.cpp b/src/msw/button.cpp index 64e3c798a2..99759d70ad 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -88,6 +88,13 @@ bool wxButton::Create(wxWindow *parent, NULL ); + if (m_hWnd == 0) + { + wxString msg; + msg.Printf(wxT("CreateWindowEx failed with error number %ld"), (long) GetLastError()); + wxFAIL_MSG(msg); + } + // Subclass again for purposes of dialog editing mode SubclassWin(m_hWnd); diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index 1be624babd..398a283a6e 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -174,7 +174,7 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id, if ( !hwnd ) { - wxLogError(_("Failed to create dialog.")); + wxFAIL_MSG(_("Failed to create dialog. You probably forgot to include wx/msw/wx.rc in your resources.")); return FALSE; }