CWinException - a Powerful Exception Class Designed to Track Win32/COM/MFC Errors

           Welcome to CWinException homepage.

           This C++ class is designed for convenient handling of errors in your C++ code (Win32).

C++ Developers

Download CWinException files

Project info, screenshots, and more

Get support

Powerful Exception C++ Class. typedef CWinException CWEx;

Correct and convenient handling of errors usually becomes a headache if you don't use a good technique. If you're interested in writing robust, readable and elegant code this class will be helpful.

The main benefit it provides is the ability to unify all sources of errors. Say it tries to gather all sorts of errors you may raise in you program.

Let's see what are those typical sources:

1) Win32 API calls, like ::CopyFile(...)
2) COM calls, which always return HRESULT values, like ::CoInitialize(...)
3) MFC calls, like CString strTmp("");

Those above are 'typical', but not alone ... Many more come with

4) STL calls
5) COM support calls (_com_error), if you use #import "smth.tlb"
6) Errors and exceptions from other libraries you use

We usually don't pretend to solve this puzzle and just ignore the stuff, except some critical spots. Well that's OK most of the time, but ... if you write commercial software how could you be sure that it won't crash in front of the customer's face? I try introducing a possible way to escape such blots and catch the goal of increasing your chances to succeed.

I bet your code won't crash even after dereferencing NULL pointer.

See this C++ class declaration

License - LGPLv3.0 License.

Project Web Hosted by   SourceForge.net

Copyright (C) 2009-2020 Alexey Veremenko. All Rights Reserved.