Windows C++ Library
Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Private Member Functions
WCL::ComException Class Reference

The exception type thrown for COM errors. More...

#include <ComException.hpp>

List of all members.

Public Member Functions

 ComException (HRESULT result, const tchar *operation)
 Construction from a non-IErrorInfo supported error.
 ComException (HRESULT result, const tstring &operation)
 Construction from a non-IErrorInfo supported error.
template<typename T >
 ComException (HRESULT result, IFacePtr< T > &object, const tchar *operation)
 Construction from an IErrorInfo supported error.
virtual ~ComException () throw ()
 Destructor.

Public Attributes

HRESULT m_result
 The underlying COM error code.

Protected Member Functions

 ComException (HRESULT result)
 Construction from an error code.

Static Protected Member Functions

static bool extractErrorInfo (IUnknown *object, const IID &iid, tstring &source, tstring &description)
 Extract the ErrorInfo details from the COM object, if present.

Private Member Functions

void formatError (HRESULT result, IUnknown *object, const IID &iid, const tchar *operation)
 Format the error using the IErrorInfo details.

Detailed Description

The exception type thrown for COM errors.


Constructor & Destructor Documentation

WCL::ComException::ComException ( HRESULT  result,
const tchar *  operation 
)

Construction from a non-IErrorInfo supported error.

Constructor for use with non-IErrorInfo errors.

The pszOperation parameter is used as the prefix for the message and the error code is appended.

WCL::ComException::ComException ( HRESULT  result,
const tstring &  operation 
)

Construction from a non-IErrorInfo supported error.

template<typename T >
WCL::ComException::ComException ( HRESULT  result,
IFacePtr< T > &  object,
const tchar *  operation 
) [inline]

Construction from an IErrorInfo supported error.

WCL::ComException::~ComException ( ) throw () [virtual]

Destructor.

WCL::ComException::ComException ( HRESULT  result) [protected]

Construction from an error code.


Member Function Documentation

bool WCL::ComException::extractErrorInfo ( IUnknown *  object,
const IID &  iid,
tstring &  source,
tstring &  description 
) [static, protected]

Extract the ErrorInfo details from the COM object, if present.

void WCL::ComException::formatError ( HRESULT  result,
IUnknown *  object,
const IID &  iid,
const tchar *  operation 
) [private]

Format the error using the IErrorInfo details.


Member Data Documentation

The underlying COM error code.


The documentation for this class was generated from the following files: