summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@nokia.com>2009-11-06 12:03:05 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-11-06 12:04:17 (GMT)
commit654cbdb901386b2a8e168cd52446abdddec1aa28 (patch)
tree23ae813168cf67a9ac63ee2fd26fea5312ae56fa /src
parent7515e36b6351e588b5324fe7be9bf4505b156793 (diff)
downloadQt-654cbdb901386b2a8e168cd52446abdddec1aa28.zip
Qt-654cbdb901386b2a8e168cd52446abdddec1aa28.tar.gz
Qt-654cbdb901386b2a8e168cd52446abdddec1aa28.tar.bz2
Move the check for HWND to be right after the CreateWindow() call
By moving the check, it ensures that the error message obtained if it fails is correct and not the error message that SetWindowLong() gives due to an invalid HWND. Merge-request: 1910 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index d13e1d1..ccf5b96 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -531,15 +531,16 @@ static HWND qt_create_internal_window(const QEventDispatcherWin32 *eventDispatch
qWinAppInst(), // application
0); // windows creation data.
+ if (!wnd) {
+ qWarning("QEventDispatcher: Failed to create QEventDispatcherWin32 internal window: %d\n", (int)GetLastError());
+ }
+
#ifdef GWLP_USERDATA
SetWindowLongPtr(wnd, GWLP_USERDATA, (LONG_PTR)eventDispatcher);
#else
SetWindowLong(wnd, GWL_USERDATA, (LONG)eventDispatcher);
#endif
- if (!wnd) {
- qWarning("QEventDispatcher: Failed to create QEventDispatcherWin32 internal window: %d\n", (int)GetLastError());
- }
return wnd;
}