Details
-
Suggestion
-
Resolution: Done
-
P3: Somewhat important
-
4.7.0
-
None
-
Windows
-
1e54f1316d30eae86bc38490f84aa55ee4568a25
Description
Inside QEventDispatcherWin32::createInternalHwnd(), there is a call to SetWindowsHookEx(). In situations where this call fails (see below), the only error message reported to the user is "Qt: INTERNALL ERROR: failed to install GetMessage hook", which gives no explanation as to why the call failed. Windows provides the GetLastError() function which should give the reason for the failure, so the Qt code should make use of that to provide the user with more information.
I encountered such a failure recently when it appeared that I was somehow running my application which was built against Qt 4.6.2 but used 4.6.1 libraries at run-time. I realise this is not supported and can lead to all sorts of undefined behaviour, but in this instance, it would have been far more useful for createInternalHwnd() to tell me something useful so that I might potentially have found the real problem sooner.
This suggestion/bug was originally reported in QTBUG-6083.