异常类Exception Classes

类库提供基于类 CException 的异常处理机制。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. 您可从 CException 派生自己的异常类型。You can derive your own exception types from CException.

MFC 提供了您可从其派生自己的异常的异常类以及其支持的所有异常的异常类。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.

CExceptionCException
异常的基类。The base class for exceptions.

CArchiveExceptionCArchiveException
存档异常。An archive exception.

CDaoExceptionCDaoException
DAO 数据库操作失败导致的异常。An exception resulting from a failure in a DAO database operation.

CDBExceptionCDBException
ODBC 数据库处理失败导致的异常。An exception resulting from a failure in ODBC database processing.

CFileExceptionCFileException
面向文件的异常。A file-oriented exception.

CMemoryExceptionCMemoryException
内存不足异常。An out-of-memory exception.

CNotSupportedExceptionCNotSupportedException
使用不支持的功能导致的异常。An exception resulting from using an unsupported feature.

COleExceptionCOleException
OLE 处理失败导致的异常。An exception resulting from a failure in OLE processing. 此类将由容器和服务器使用。This class is used by both containers and servers.

COleDispatchExceptionCOleDispatchException
自动化期间出错导致的异常。An exception resulting from an error during automation. 自动化异常由自动化服务器引发,由自动化客户端捕获。Automation exceptions are thrown by automation servers and caught by automation clients.

CResourceExceptionCResourceException
Windows 资源加载失败导致的异常。An exception resulting from a failure to load a Windows resource.

CUserExceptionCUserException
用于停止用户启动的操作的异常。An exception used to stop a user-initiated operation. 通常,用户在此异常引发前已收到有关问题的通知。Typically, the user has been notified of the problem before this exception is thrown.

请参阅See also

类概述Class Overview