ReactOS  0.4.13-dev-73-gcfe54aa
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  }
HRESULT hr
Definition: shlfolder.c:183
String toString() const
Context _context
Definition: shellclasses.h:155
smooth NULL
Definition: ftsmooth.c:416
const char * _file
Definition: shellclasses.h:157
COMExceptionBase super
Definition: shellclasses.h:115
#define LOG(txt)
Definition: utility.h:102

◆ 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),
129  _file(file), _line(line)
130  {
131  LOG(toString());
132  LOG(CURRENT_CONTEXT.getStackTrace());
133  }
HRESULT hr
Definition: shlfolder.c:183
String toString() const
Context _context
Definition: shellclasses.h:155
Definition: parser.c:48
const char * _file
Definition: shellclasses.h:157
COMExceptionBase super
Definition: shellclasses.h:115
#define LOG(txt)
Definition: utility.h:102
Definition: fci.c:126

◆ 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  }
HRESULT hr
Definition: shlfolder.c:183
String toString() const
Context _context
Definition: shellclasses.h:155
smooth NULL
Definition: ftsmooth.c:416
const char * _file
Definition: shellclasses.h:157
COMExceptionBase super
Definition: shellclasses.h:115
#define LOG(txt)
Definition: utility.h:102

◆ 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),
147  _file(file), _line(line)
148  {
149  LOG(toString());
150  LOG(CURRENT_CONTEXT.getStackTrace());
151  }
HRESULT hr
Definition: shlfolder.c:183
String toString() const
Context _context
Definition: shellclasses.h:155
Definition: parser.c:48
const char * _file
Definition: shellclasses.h:157
COMExceptionBase super
Definition: shellclasses.h:115
#define LOG(txt)
Definition: utility.h:102
Definition: fci.c:126

Member Function Documentation

◆ toString()

String COMException::toString ( ) const

Definition at line 70 of file shellclasses.cpp.

71 {
72  TCHAR msg[4*BUFFER_LEN];
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 }
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define _stprintf_s2(b, l, f, p1, p2)
Definition: utility.h:216
GLdouble n
Definition: glext.h:7729
CHAR * LPTSTR
Definition: xmlstorage.h:192
Context _context
Definition: shellclasses.h:155
#define BUFFER_LEN
Definition: utility.h:97
const char * _file
Definition: shellclasses.h:157
r l[0]
Definition: byte_order.h:167
char TCHAR
Definition: xmlstorage.h:189
#define TEXT(s)
Definition: k32.h:26
#define msg(x)
Definition: auth_time.c:54
GLfloat GLfloat p
Definition: glext.h:8902
LPCTSTR ErrorMessage() const
Definition: shellclasses.h:84

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: