diff options
author | Peter Hartmann <peter.hartmann@nokia.com> | 2009-10-27 14:10:46 (GMT) |
---|---|---|
committer | Peter Hartmann <peter.hartmann@nokia.com> | 2009-10-27 14:13:18 (GMT) |
commit | d0b0e0ed8ac857d78e497b74bb1c3596273c53ba (patch) | |
tree | 2b1e41bc83e4a568c466a465d406359b78f98ab2 /src/corelib | |
parent | 26713a8b3fa4b82ea18c314c01b4d7ccb54d1125 (diff) | |
download | Qt-d0b0e0ed8ac857d78e497b74bb1c3596273c53ba.zip Qt-d0b0e0ed8ac857d78e497b74bb1c3596273c53ba.tar.gz Qt-d0b0e0ed8ac857d78e497b74bb1c3596273c53ba.tar.bz2 |
QLibrary on Windows: Do not show error boxes when library load fails
When loading a library fails, the error message "The application or DLL
... is not a valid Windows image. Please check this against your
installation diskette." is shown, which is not very helpful.
Task-number: QT-2357
Reviewed-by: Marius Storm-Olsen
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/plugin/qlibrary.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index 2b463a1..6496876 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -659,7 +659,10 @@ bool QLibraryPrivate::isPlugin(QSettings *settings) #endif if (!pHnd) { #ifdef Q_OS_WIN + //avoid 'Bad Image' message box + UINT oldmode = SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX); hTempModule = ::LoadLibraryEx((wchar_t*)QDir::toNativeSeparators(fileName).utf16(), 0, DONT_RESOLVE_DLL_REFERENCES); + SetErrorMode(oldmode); #else # if defined(Q_OS_SYMBIAN) //Guard against accidentally trying to load non-plugin libraries by making sure the stub exists |