Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-14301

QEventDispatcherWin32::createInternalHwnd() should report reason for failure of SetWindowsHookEx()

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P3: Somewhat important
    • 5.4.0
    • 4.7.0
    • Core: Event loop
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            iamsergio Sergio Martins
            jirauser11888 user-aa151 (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes