X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FOS%2FDLLManager.cxx;h=727ba18786d834a81acf0e4e941e051ada1204ca;hb=d8ebffc6ece697ddf7b358946ef5d9c9cd7191fe;hp=ab3cf56d2e742f67b51a186b3eba612d3f932651;hpb=c26e1b67af96bd1b11e8da2ab9145dbaf0140deb;p=cpPlugins.git diff --git a/lib/cpPlugins/OS/DLLManager.cxx b/lib/cpPlugins/OS/DLLManager.cxx index ab3cf56..727ba18 100644 --- a/lib/cpPlugins/OS/DLLManager.cxx +++ b/lib/cpPlugins/OS/DLLManager.cxx @@ -12,7 +12,12 @@ Load( const std::string& fname, std::string& error ) { void* hnd = NULL; #ifdef cpPlugins_OS_Windows + UINT old = ::SetErrorMode( SEM_FAILCRITICALERRORS ); + ::SetErrorMode( old | SEM_FAILCRITICALERRORS ); hnd = ::LoadLibraryA( fname.c_str( ) ); + ::SetErrorMode( old ); + if( hnd == NULL ) + error = "Could not load library."; #else // cpPlugins_OS_Windows hnd = dlopen( fname.c_str( ), RTLD_LAZY | RTLD_GLOBAL ); if( hnd == NULL )