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

[IDC] LoadLibraryEx prompting error message box when dependencies not found

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.9
    • 5.8.0
    • None
    • Windows 7 SP1 x64
    • dfc34ee575ca7790ec403c6510a9ccc469c07997 (qtactive/5.9, 4.4.2017, 5.9)

    Description

      When compiling Qt source from Git branch 5.8 with examples. activeqt example try to load some libraries with idc.exe. Qt5Widget.dll is needed but the search path is not correct for the first try in the code because Qt5Widgets is not in the search path, src/tools/idc/main.cpp:182

      HMODULE result = LoadLibraryEx(inputC, NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
      

      This will prompt a windows error message prompt if dependency is not found. This should be silently done even if dependencies is not found when compiling Qt and example. Library is successfully loaded after with:

      result = LoadLibraryEx(inputC, NULL, 0);

      In order to make LoadLibraryEx silent, we can use SetErrorMode:

      UINT oldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS);
      HMODULE result = LoadLibraryEx(inputC, NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
      SetErrorMode(oldErrorMode);
      

      This bug is related with QTBUG-48586.

      Attachments

        For Gerrit Dashboard: QTBUG-59791
        # Subject Branch Project Status CR V

        Activity

          People

            kleint Friedemann Kleint
            Astraya Julian
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes