From dfc34ee575ca7790ec403c6510a9ccc469c07997 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 3 Apr 2017 15:47:38 +0200 Subject: idc: Suppress error dialogs should LoadLibrary[Ex]() fail Task-number: QTBUG-59791 Change-Id: I1b7f6f9ca12f8e42166104512a85ddb55d0b8e28 Reviewed-by: Oliver Wolff --- src/tools/idc/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/idc/main.cpp b/src/tools/idc/main.cpp index cceae07..19bd874 100644 --- a/src/tools/idc/main.cpp +++ b/src/tools/idc/main.cpp @@ -178,11 +178,13 @@ static HMODULE loadLibraryQt(const QString &input) { const wchar_t *inputC = reinterpret_cast(input.utf16()); // Load DLL with the folder containing the DLL temporarily added to the search path when loading dependencies + const UINT oldErrorMode = SetErrorMode(SEM_FAILCRITICALERRORS); HMODULE result = LoadLibraryEx(inputC, NULL, LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR | LOAD_LIBRARY_SEARCH_DEFAULT_DIRS); // If that fails, call with flags=0 to get LoadLibrary() behavior (search %PATH%). if (!result) result = LoadLibraryEx(inputC, NULL, 0); + SetErrorMode(oldErrorMode); return result; } -- cgit v1.2.3