I write a simple program that used external dll when I call a function of that dll, dll run a thread then function passed succesfully but after while thread cause exception and program closed I want to now how to handle this bug so my program can continue work
2 Answers
You can create an event handler for unhandled exceptions in a given app domain
http://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception(v=vs.71).aspx
If nothing else handles the Exception, that event handler will be invoked.
1 Comment
Hamid
Hi thanxs for answer but after unhandledexception event fire application will terminate.
First you need to know what releases the exception and then you should work on preventing it. You can disassamble the dll with http://www.reflector.net to view the code inside the dll.
1 Comment
Hamid
thanx I know where exception is occurre but I cant handle it.