Public Types | Public Member Functions | Public Attributes

COMException Struct Reference

Exception with context information. More...

#include <shellclasses.h>

Inheritance diagram for COMException:
Inheritance graph
[legend]
Collaboration diagram for COMException:
Collaboration graph
[legend]

List of all members.

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 Attributes

Context _context
const char * _file
int _line

Detailed Description

Exception with context information.

Definition at line 113 of file shellclasses.h.


Member Typedef Documentation

typedef COMExceptionBase COMException::super

Definition at line 115 of file shellclasses.h.


Constructor & Destructor Documentation

COMException::COMException ( HRESULT  hr ) [inline]

Definition at line 117 of file shellclasses.h.

References CURRENT_CONTEXT, LOG, and toString().

     :  super(hr),
        _context(CURRENT_CONTEXT),
        _file(NULL), _line(0)
    {
        LOG(toString());
        LOG(CURRENT_CONTEXT.getStackTrace());
    }

Here is the call graph for this function:

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

Definition at line 126 of file shellclasses.h.

References CURRENT_CONTEXT, LOG, and toString().

     :  super(hr),
        _context(CURRENT_CONTEXT),
        _file(file), _line(line)
    {
        LOG(toString());
        LOG(CURRENT_CONTEXT.getStackTrace());
    }

Here is the call graph for this function:

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

Definition at line 135 of file shellclasses.h.

References CURRENT_CONTEXT, LOG, and toString().

     :  super(hr),
        _context(CURRENT_CONTEXT),
        _file(NULL), _line(0)
    {
        LOG(toString());
        LOG(CURRENT_CONTEXT.getStackTrace());
    }

Here is the call graph for this function:

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

Definition at line 144 of file shellclasses.h.

References CURRENT_CONTEXT, LOG, and toString().

     :  super(hr),
        _context(CURRENT_CONTEXT),
        _file(file), _line(line)
    {
        LOG(toString());
        LOG(CURRENT_CONTEXT.getStackTrace());
    }

Here is the call graph for this function:


Member Function Documentation

String COMException::toString (  ) const

Definition at line 70 of file shellclasses.cpp.

References _context, _file, _line, _stprintf_s2, BUFFER_LEN, TEXT, and Context::toString().

Referenced by COMException(), and HandleException().

{
    TCHAR msg[4*BUFFER_LEN];
#ifdef __STDC_WANT_SECURE_LIB__
    int l = 4*BUFFER_LEN;
#endif
    LPTSTR p = msg;

    int n = _stprintf_s2(p, l, TEXT("%s\nContext: %s"), super::ErrorMessage(), (LPCTSTR)_context.toString());
    p += n;
#ifdef __STDC_WANT_SECURE_LIB__
    l -= n;
#endif

    if (_file)
        p += _stprintf_s2(p, l, TEXT("\nLocation: %hs:%d"), _file, _line);

    return msg;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 155 of file shellclasses.h.

Referenced by toString().

const char* COMException::_file

Definition at line 157 of file shellclasses.h.

Referenced by toString().

Definition at line 158 of file shellclasses.h.

Referenced by toString().


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

ROS Explorer Source Code Documentation
generated on 02.01.2013 by doxygen

ROS Explorer Homepage