I am a bit confused. On the one hand, you write catch(std::exception) did not work (you should use catch(const std::exception&) , BTW), on the other hand, you also wrote you called std::exception::what() . How did you do this if you did not have std::exception in the first place?
In any case, once you have caught anything other than ... , you can try to register the RTTI information:
#include <typeinfo> try { foreign_code(my_data); } catch(const some_type& x) { std::cerr << "Yikes! Caught exception of type '" << typeid(x).name() << "' with its hand in the cookie jar!\n"; std::abort(); }
While the standard makes no assumptions about the result of std::type_info::name() , most (if not all) compilers will generate code that emits what is at least useful.
When you are in the VS debugger, you can also configure it so that it stops under any exceptions. This gives you a stack trace and thus can give you an idea of ββwhat data passed to the DLL might cause the problem.
source share