Is this possible ? i.e to set up an all encompassing exception handling function that gets called by Windows no matter what and where an exception occurs. (so I can output some debug info of my own). Thanks.
Some test suites do that. Some even write [tt]main[/tt] for you, and you use a function called [tt]test_main[/tt] or something similar. Check out Boost.Test at
for an example of such a framework that already exists.
You can, of course, create a block-local object in [tt]main[/tt], and have its destructor do something. The destructor will get called whenever the object goes out of scope, which includes when the application stops due to an uncaught exception.
You won't have access to the exception itself in the destructor, however, and it sounded like you probably wanted that.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.