Browse Source

show-dll-error-dialog

David Rose 16 years ago
parent
commit
e9b573cb19
2 changed files with 11 additions and 1 deletions
  1. 0 1
      dtool/src/dtoolutil/load_dso.cxx
  2. 11 0
      dtool/src/prc/configPageManager.cxx

+ 0 - 1
dtool/src/dtoolutil/load_dso.cxx

@@ -50,7 +50,6 @@ load_dso(const DSearchPath &path, const Filename &filename) {
     return NULL;
   }
   string os_specific = abspath.to_os_specific();
-  SetErrorMode(0);
   
   // Try using LoadLibraryEx, if possible.
   typedef HMODULE (WINAPI *tLoadLibraryEx)(LPCTSTR, HANDLE, DWORD);

+ 11 - 0
dtool/src/prc/configPageManager.cxx

@@ -390,6 +390,17 @@ reload_implicit_pages() {
               "or \"mac\"."));
   PandaFileStreamBuf::_newline_mode = newline_mode;
 #endif  // USE_PANDAFILESTREAM
+
+#ifdef WIN32
+  // We don't necessarily want an error dialog when we fail to load a
+  // .dll file.  But sometimes it is useful for debugging.
+  if (ConfigVariableBool("show-dll-error-dialog", false)) {
+    SetErrorMode(0);
+  } else {
+    SetErrorMode(SEM_FAILCRITICALERRORS);
+  } 
+#endif
+
 }
 
 ////////////////////////////////////////////////////////////////////