ReactOS  0.4.14-dev-614-gbfd8a84
COMExceptionBase Struct Reference

COM ExceptionBase class as replacement for _com_error. More...

#include <shellclasses.h>

Inheritance diagram for COMExceptionBase:

Public Member Functions

 COMExceptionBase (HRESULT hr)
 
HRESULT Error () const
 
LPCTSTR ErrorMessage () const
 

Protected Attributes

HRESULT _hr
 
String _msg
 

Detailed Description

COM ExceptionBase class as replacement for _com_error.

Definition at line 72 of file shellclasses.h.

Constructor & Destructor Documentation

◆ COMExceptionBase()

COMExceptionBase::COMExceptionBase ( HRESULT  hr)
inline

Definition at line 74 of file shellclasses.h.

75  : _hr(hr)
76  {
77  }
HRESULT hr
Definition: shlfolder.c:183

Member Function Documentation

◆ Error()

HRESULT COMExceptionBase::Error ( ) const
inline

Definition at line 79 of file shellclasses.h.

80  {
81  return _hr;
82  }

◆ ErrorMessage()

LPCTSTR COMExceptionBase::ErrorMessage ( ) const
inline

Definition at line 84 of file shellclasses.h.

85  {
86  if (_msg.empty()) {
87  LPTSTR pBuf;
88 
91  _msg = pBuf;
92  LocalFree(pBuf);
93  } else {
94  TCHAR buffer[128];
95  _sntprintf(buffer, COUNTOF(buffer), TEXT("unknown Exception: 0x%08lX"), _hr);
96  _msg = buffer;
97  }
98  }
99 
100  return _msg;
101  }
#define LANG_NEUTRAL
Definition: nls.h:22
#define SUBLANG_DEFAULT
Definition: nls.h:168
GLuint buffer
Definition: glext.h:5915
CHAR * LPTSTR
Definition: xmlstorage.h:192
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:400
smooth NULL
Definition: ftsmooth.c:416
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:404
char TCHAR
Definition: xmlstorage.h:189
#define FormatMessage
Definition: winbase.h:3629
#define _sntprintf
Definition: xmlstorage.h:201
#define TEXT(s)
Definition: k32.h:26
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1577
#define MAKELANGID(p, s)
Definition: nls.h:15
#define COUNTOF(x)
Definition: utility.h:93

Referenced by COMException::toString().

Member Data Documentation

◆ _hr

HRESULT COMExceptionBase::_hr
protected

Definition at line 104 of file shellclasses.h.

Referenced by Error(), and ErrorMessage().

◆ _msg

String COMExceptionBase::_msg
mutableprotected

Definition at line 105 of file shellclasses.h.

Referenced by ErrorMessage().


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