ReactOS 0.4.15-dev-7924-g5949c20
COMException Struct Reference

Exception with context information. More...

#include <shellclasses.h>

Inheritance diagram for COMException:
Collaboration diagram for COMException:

Public Types

typedef COMExceptionBase super
 

Public Member Functions

 COMException (HRESULT hr)
 
 COMException (HRESULT hr, const char *file, int line)
 
 COMException (HRESULT hr, const String &obj)
 
 COMException (HRESULT hr, const String &obj, const char *file, int line)
 
String toString () const
 
- Public Member Functions inherited from COMExceptionBase
 COMExceptionBase (HRESULT hr)
 
HRESULT Error () const
 
LPCTSTR ErrorMessage () const
 

Public Attributes

Context _context
 
const char_file
 
int _line
 

Additional Inherited Members

- Protected Attributes inherited from COMExceptionBase
HRESULT _hr
 
String _msg
 

Detailed Description

Exception with context information.

Definition at line 113 of file shellclasses.h.

Member Typedef Documentation

◆ super

Definition at line 115 of file shellclasses.h.

Constructor & Destructor Documentation

◆ COMException() [1/4]

COMException::COMException ( HRESULT  hr)
inline

Definition at line 117 of file shellclasses.h.

118 : super(hr),
119 _context(CURRENT_CONTEXT),
120 _file(NULL), _line(0)
121 {
122 LOG(toString());
123 LOG(CURRENT_CONTEXT.getStackTrace());
124 }
#define NULL
Definition: types.h:112
#define LOG(txt)
Definition: utility.h:102
HRESULT hr
Definition: shlfolder.c:183
const char * _file
Definition: shellclasses.h:157
Context _context
Definition: shellclasses.h:155
COMExceptionBase super
Definition: shellclasses.h:115
String toString() const

◆ COMException() [2/4]

COMException::COMException ( HRESULT  hr,
const char file,
int  line 
)
inline

Definition at line 126 of file shellclasses.h.

127 : super(hr),
128 _context(CURRENT_CONTEXT),
130 {
131 LOG(toString());
132 LOG(CURRENT_CONTEXT.getStackTrace());
133 }
Definition: fci.c:127
Definition: parser.c:49

◆ COMException() [3/4]

COMException::COMException ( HRESULT  hr,
const String obj 
)
inline

Definition at line 135 of file shellclasses.h.

136 : super(hr),
137 _context(CURRENT_CONTEXT),
138 _file(NULL), _line(0)
139 {
140 LOG(toString());
141 LOG(CURRENT_CONTEXT.getStackTrace());
142 }

◆ COMException() [4/4]

COMException::COMException ( HRESULT  hr,
const String obj,
const char file,
int  line 
)
inline

Definition at line 144 of file shellclasses.h.

145 : super(hr),
146 _context(CURRENT_CONTEXT),
148 {
149 LOG(toString());
150 LOG(CURRENT_CONTEXT.getStackTrace());
151 }

Member Function Documentation

◆ toString()

String COMException::toString ( ) const

Definition at line 70 of file shellclasses.cpp.

71{
73#ifdef __STDC_WANT_SECURE_LIB__
74 int l = 4*BUFFER_LEN;
75#endif
76 LPTSTR p = msg;
77
78 int n = _stprintf_s2(p, l, TEXT("%s\nContext: %s"), super::ErrorMessage(), (LPCTSTR)_context.toString());
79 p += n;
80#ifdef __STDC_WANT_SECURE_LIB__
81 l -= n;
82#endif
83
84 if (_file)
85 p += _stprintf_s2(p, l, TEXT("\nLocation: %hs:%d"), _file, _line);
86
87 return msg;
88}
#define msg(x)
Definition: auth_time.c:54
r l[0]
Definition: byte_order.h:168
GLdouble n
Definition: glext.h:7729
GLfloat GLfloat p
Definition: glext.h:8902
#define TEXT(s)
Definition: k32.h:26
#define _stprintf_s2(b, l, f, p1, p2)
Definition: utility.h:216
#define BUFFER_LEN
Definition: utility.h:97
LPCTSTR ErrorMessage() const
Definition: shellclasses.h:84
char TCHAR
Definition: xmlstorage.h:189
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
CHAR * LPTSTR
Definition: xmlstorage.h:192

Referenced by COMException().

Member Data Documentation

◆ _context

Context COMException::_context

Definition at line 155 of file shellclasses.h.

Referenced by toString().

◆ _file

const char* COMException::_file

Definition at line 157 of file shellclasses.h.

Referenced by toString().

◆ _line

int COMException::_line

Definition at line 158 of file shellclasses.h.

Referenced by toString().


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