From 23035521721c540a7aa92408ec72387a3d931b24 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 11 May 2008 17:18:15 +0000 Subject: [PATCH] assert if the window is being recreated, this indicates a bug in the user code and can be difficult to find without the help of this assert git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53555 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/window.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 2fb78f4a7c..3702df9b6c 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -3669,6 +3669,12 @@ bool wxWindowMSW::MSWCreate(const wxChar *wclass, WXDWORD style, WXDWORD extendedStyle) { + // check a common bug in the user code: if the window is created with a + // non-default ctor and Create() is called too, we'd create 2 HWND for a + // single wxWindow object and this results in all sorts of trouble, + // especially for wxTLWs + wxCHECK_MSG( !m_hWnd, true, "window can't be recreated" ); + // choose the position/size for the new window int x, y, w, h; (void)MSWGetCreateWindowCoords(pos, size, x, y, w, h); -- 2.45.2