src/corelib/plugin/qlibrary.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
child 7 f7bc934e204c
--- a/src/corelib/plugin/qlibrary.cpp	Tue Jan 26 12:42:25 2010 +0200
+++ b/src/corelib/plugin/qlibrary.cpp	Tue Feb 02 00:43:10 2010 +0200
@@ -659,7 +659,10 @@
 #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
@@ -741,7 +744,7 @@
 
     pluginState = IsNotAPlugin; // be pessimistic
 
-    if ((qt_version > QT_VERSION) || ((QT_VERSION & 0xff0000) > (qt_version & 0xff0000))) {
+    if ((qt_version & 0x00ff00) > (QT_VERSION & 0x00ff00) || (qt_version & 0xff0000) != (QT_VERSION & 0xff0000)) {
         if (qt_debug_component()) {
             qWarning("In %s:\n"
                  "  Plugin uses incompatible Qt library (%d.%d.%d) [%s]",