From 11a7d2c4c2e23f6abd37688a4ca31d31591eadec Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Tue, 19 May 2015 14:40:33 +0100 Subject: [PATCH] Stopped Windows plugin loader from throwing #4661 System error message hidden with 'SetErrorMode(SEM_FAILCRITICALERRORS)' --- src/lib/arch/win32/ArchMiscWindows.cpp | 3 +++ src/lib/arch/win32/ArchPluginWindows.cpp | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lib/arch/win32/ArchMiscWindows.cpp b/src/lib/arch/win32/ArchMiscWindows.cpp index 4171f1c4..92aad1a4 100644 --- a/src/lib/arch/win32/ArchMiscWindows.cpp +++ b/src/lib/arch/win32/ArchMiscWindows.cpp @@ -60,6 +60,9 @@ ArchMiscWindows::cleanup() void ArchMiscWindows::init() { + // stop windows system error dialogs from showing. + SetErrorMode(SEM_FAILCRITICALERRORS); + s_dialogs = new Dialogs; } diff --git a/src/lib/arch/win32/ArchPluginWindows.cpp b/src/lib/arch/win32/ArchPluginWindows.cpp index 2a223746..ce814cf5 100644 --- a/src/lib/arch/win32/ArchPluginWindows.cpp +++ b/src/lib/arch/win32/ArchPluginWindows.cpp @@ -60,8 +60,9 @@ ArchPluginWindows::load() HINSTANCE library = LoadLibrary(path.c_str()); if (library == NULL) { - LOG((CLOG_ERR "failed to load plugin: %s %d", (*it).c_str(), GetLastError())); - throw XArch(new XArchEvalWindows); + String error = XArchEvalWindows().eval(); + LOG((CLOG_ERR "failed to load plugin '%s', error: %s", (*it).c_str(), error.c_str())); + continue; } void* lib = reinterpret_cast(library);