How to convert GPF to C++ exception in VC2005?

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
VC2005 does not throw exceptions that can be caught with catch(...). My goal is to have the code that could handle hardware exceptions without terminating the program and without leaving memory leaks afterwards. In such case throwing C++ exception from the location of GPF would be very convenient as it would unwind the stack on its way to exception handler. Is there a way to do it in VC2005 without too many changes?

I tried to use __try, __except but it seems that they do not unwind the stack the same way C++ exceptions do. Adding __try, __except to every location where GPF or division by zero may occur is not practical.



View the full article
 
Back
Top