Karachi   ->   Sweden   ->   Karachi, again   ->   Dubai   ->   Bahrain   ->   Karachi, once more   ->   London and Leeds

Thursday, November 15, 2007

A Visual C++ Exception FAQ

It's a gem! The page discusses structured exception handling (SEH) in Windows alongwith the standard C++ Exception Handling (EH). It also explains how various versions of Visual C++ differ in terms of their treatment to exceptions.

There are two exception handling modes in VC++ --- synchronous and asynchronous. In extremely simple words, synchronous exceptions are those that are literary "thrown" in the code, while asynchronous can be thought of low-level runtime exceptions (like division by zero, null pointer, etc.) Various versions of Visual Studio behave differently in terms of catching Windows structured exceptions in catch(...) blocks, depending on compiler switches and debug/ release mode settings.

I wish I had read all this a few years earlier!

No comments:

Post a Comment