- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I am loading a DLL dynamically in which an exception of type E may be thrown from method M. In the try block in the main program, the type information for the exception appears to be lost. In other words, in the code
try{
M
} catch( E &e )
{
cout << "Caught an exception of type e" << endl;
}
catch(...)
{
cout << "Unknown exception" << endl;
}
M is in the dynamically loaded DLL with throws an exception of type E. But the catch block catch(E &e) is never entered: type info is lost. The catch(...) is entered. Is there any way around this?
Thanks very much,
Mac
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
if you mean by dynamically loading a library you use dlopen then you have to use the flag RTLD_GLOBAL otherwise it will not load the exception information properly.
I hope this helps.
Otto
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page