COleDispatchException Class

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at COleDispatchException Class.

Handles exceptions specific to the OLE IDispatch interface, which is a key part of OLE automation.

class COleDispatchException : public CException  

Public Data Members

NameDescription
COleDispatchException::m_dwHelpContextHelp context for error.
COleDispatchException::m_strDescriptionVerbal error description.
COleDispatchException::m_strHelpFileHelp file to use with m_dwHelpContext.
COleDispatchException::m_strSourceApplication that generated the exception.
COleDispatchException::m_wCodeIDispatch-specific error code.

Like the other exception classes derived from the CException base class, COleDispatchException can be used with the THROW, THROW_LAST, TRY, CATCH, AND_CATCH, and END_CATCH macros.

In general, you should call [AfxThrowOleDispatchException]--brokenlink--(../Topic/not%20found.md#afxthrowoledispatchexception) to create and throw a COleDispatchException object.

For more information on exceptions, see the articles Exception Handling (MFC) and Exceptions: OLE Exceptions.

CObject

CException

COleDispatchException

Header: afxdisp.h

Identifies a help context in your application's help (.HLP) file.

DWORD m_dwHelpContext;  

Remarks

This member is set by the function [AfxThrowOleDispatchException]--brokenlink--(../Topic/not%20found.md#afxthrowoledispatchexception) when an exception is thrown.

Example

See the example for COleDispatchDriver::CreateDispatch.

Contains a verbal error description, such as "Disk full."

CString m_strDescription;  

Remarks

This member is set by the function [AfxThrowOleDispatchException]--brokenlink--(../Topic/not%20found.md#afxthrowoledispatchexception) when an exception is thrown.

Example

See the example for COleDispatchDriver::CreateDispatch.

The framework fills in this string with the name of the application's help file.

CString m_strHelpFile;  

The framework fills in this string with the name of the application that generated the exception.

CString m_strSource;  

Example

See the example for COleDispatchDriver::CreateDispatch.

Contains an error code specific to your application.

WORD m_wCode;  

Remarks

This member is set by the function [AfxThrowOleDispatchException]--brokenlink--(../Topic/not%20found.md#afxthrowoledispatchexception) when an exception is thrown.

MFC Sample CALCDRIV
CException Class
Hierarchy Chart
COleDispatchDriver Class
COleException Class

Show: