comet::com_error Class Reference
[ErrorHandlingErrorHandling]

#include <comet/error.h>

Collaboration diagram for comet::com_error:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 com_error (HRESULT hr)
 Construct com_error from HRESULT.
 com_error (const bstr_t &msg, HRESULT hr=E_FAIL)
 Construct com_error from HRESULT and textual description.
 com_error (const bstr_t &msg, HRESULT hr, const bstr_t &src, const uuid_t &iid=uuid_t(), const bstr_t &helpFile=bstr_t(), DWORD helpContext=-1)
 Construct com_error from HRESULT, textual description, source, iid, help.
 com_error (HRESULT hr, const com_ptr< IErrorInfo > &ei)
 Construct with an error-info and hresult.
const char * what () const throw ()
 Return a string with a description of the error.
std::string s_str () const
 Returns a std::string with a description of the error.
std::wstring w_str () const
 Returns a std::wstring with a description of the error.
tstring t_str () const
 Returns a tstring with a description of the error.
HRESULT hr () const throw ()
com_ptr< IErrorInfo > get_ei () const
 Return the error-info object.
wrappers for IErrorInfo
bstr_t description () const
 Description of the error.
bstr_t source () const
 The error source description.
GUID guid () const
 Interface IID.
bstr_t help_file () const
 Helpfile name.
DWORD help_context () const
 Help conext.

Detailed Description

COM error.


Constructor & Destructor Documentation

comet::com_error::com_error HRESULT  hr  )  [inline, explicit]
 

Construct com_error from HRESULT.

Parameters:
hr HRESULT value of error.

comet::com_error::com_error const bstr_t msg,
HRESULT  hr = E_FAIL
[inline, explicit]
 

Construct com_error from HRESULT and textual description.

Parameters:
msg Description of error.
hr HRESULT value of error.

comet::com_error::com_error const bstr_t msg,
HRESULT  hr,
const bstr_t src,
const uuid_t iid = uuid_t(),
const bstr_t helpFile = bstr_t(),
DWORD  helpContext = -1
[inline, explicit]
 

Construct com_error from HRESULT, textual description, source, iid, help.

Parameters:
msg Description of error.
hr HRESULT value of error.
src Description of source line
iid Interface the error was on
helpFile Name of help file
helpContext Name of help Context


Member Function Documentation

HRESULT comet::com_error::hr  )  const throw () [inline]
 

Return the HRESULT for the error.

const char* comet::com_error::what  )  const throw () [inline]
 

Return a string with a description of the error.

what() uses Description from IErrorInfo if such is present, otherwise FormatMessage is used to create a description of the HRESULT error value.

Return values:
A const char* string with a textual description of the error.


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