   C++ Exceptions
  Hi Folks,I use a unstable library developed by unaccess group. I have the complete list library function(.h and .lib) and when I call the second time one of then, a not controled exception is launched. Imposible Access to read location 0x0000000 (Obiusly!!).My question is: How can I manage that excepcion from my app, although I can't change the library. Now, excepcion rise and APP crash.Thank you.   
  Look into Structured Exception Handling. However, even if you can catch te access violation, the only safe thing you can do is exit your app as fast as possible, since the heap or even stack could be completely trashed by this stage.   ;  If the library is that bad (and you're 100% sure it's the library itself and not the way you're using it), complain to the library vendor/developers and get them to fix thier stuff.If that doesn't work try very hard not to use it at all.  Point out to your boss the ongoing maintenance cost of constantly having to look at bogus breaks caused by the library doing something stupid.If you can't help but use it try to isolate it to a different process.  Wrap it in a RPC interface or some homebrew protocol.  When it crashes let it crash and spin up a new instance in a new process.  Then at least you don't have to worry about the library corrupting memory in some subtle way.If you can't do that the only thing you have left is SEH.  Be prepared to spend the next several years babysitting your app and looking at mysterious unreproducable crashes.   ;  Are you sure that you're not passing 0 pointers?;  You can try catching the exceptions via a VectoredExceptionHandler.Reference:AddVectoredExceptionHandler - http://msdn2.microsoft.com/en-us/library/ms679274.aspxRemoveVectoredExceptionHandler - http://msdn2.microsoft.com/en-us/library/ms680571.aspxExample:#define _WIN32_WINNT 0x0501#include <windows.h>LONG WINAPI CatchAccessViolation(struct _EXCEPTION_POINTERS *ExceptionInfo ){    if ( ExceptionInfo->ExceptionRecord->ExceptionCode ==EXCEPTION_ACCESS_VIOLATION )    {    ...    }    return EXCEPTION_CONTINUE_EXECUTION;}PVOID handlerPtr = AddVectoredExceptionHandler( 0, CatchAccessViolation );Longer Example: http://msdn2.microsoft.com/en-us/library/ms681411.aspxHope this helps :)