The class library provides an exception-handling mechanism based on class CException. The application framework uses exceptions in its code; you can also use them in yours. For more information, see the article Exceptions. You can derive your own exception types from CException.
MFC provides an exception class from which you can derive your own exception as well as exception classes for all of the exceptions it supports.