GME  13
Classes | Defines | Functions
CommonError.h File Reference

Go to the source code of this file.

Classes

class  hresult_exception

Defines

#define NOTHROW   throw()
#define COMTHROW(FUNC)
#define VERIFYTHROW(FUNC)
#define COMVERIFY(FUNC)   VERIFY(SUCCEEDED(FUNC))
#define HR_THROW(_hr)
#define COMTRY   try
#define CATCH_CMEMORY_EXCEPTION(CLEANUP)
#define COMCATCH(CLEANUP)
#define COMRETURN(HR)
#define CHECK_IN(PTR)
#define CHECK_OUT(PTR)
#define CHECK_INOUT(PTR)
#define E_INVALID_USAGE   _HRESULT_TYPEDEF_(0x80731001)
#define E_EXCEPTION   _HRESULT_TYPEDEF_(0x80731002)
#define E_CONVERSION   _HRESULT_TYPEDEF_(0x80731003)
#define E_GETALL   _HRESULT_TYPEDEF_(0x80731004)
#define E_OUT_NOT_EMPTY   _HRESULT_TYPEDEF_(0x80731005)
#define E_SAMEPROJECT   _HRESULT_TYPEDEF_(0x80731006)
#define E_NOTFOUND   _HRESULT_TYPEDEF_(0x80731007)
#define E_FILEOPEN   _HRESULT_TYPEDEF_(0x80731008)
#define E_VERIFY   _HRESULT_TYPEDEF_(0x80731009)
#define E_COMTHROW_TEST   _HRESULT_TYPEDEF_(0x8073100A)
#define E_COMMON_FIRST   E_INVALID_USAGE
#define E_COMMON_LAST   E_COMTHROW_TEST
#define E_LOCK_VIOLATION   _HRESULT_TYPEDEF_(0x80732001)
#define E_INVALID_LOCK_VALUE   _HRESULT_TYPEDEF_(0x80732002)
#define E_ATTRID   _HRESULT_TYPEDEF_(0x80732003)
#define E_METAID   _HRESULT_TYPEDEF_(0x80732004)
#define E_METAPROJECT   _HRESULT_TYPEDEF_(0x80732005)
#define E_REPOSITORY   _HRESULT_TYPEDEF_(0x80732006)
#define E_PROJECT_MISMATCH   _HRESULT_TYPEDEF_(0x80732007)
#define E_ZOMBIE   _HRESULT_TYPEDEF_(0x80732008)
#define E_VALTYPE   _HRESULT_TYPEDEF_(0x80732009)
#define E_TRANSACTION   _HRESULT_TYPEDEF_(0x8073200A)
#define E_OBJECTEXISTS   _HRESULT_TYPEDEF_(0x8073200B)
#define E_TERRITORY   _HRESULT_TYPEDEF_(0x8073200C)
#define E_NOTLOCKED   _HRESULT_TYPEDEF_(0x8073200D)
#define E_REPOSITORY_DATA   _HRESULT_TYPEDEF_(0x8073200E)
#define E_NONEMPTY_COLL   _HRESULT_TYPEDEF_(0x8073200F)
#define E_UNKNOWN_STORAGE   _HRESULT_TYPEDEF_(0x80732010)
#define E_BINFILE   _HRESULT_TYPEDEF_(0x80732011)
#define E_NAMEMISSING   _HRESULT_TYPEDEF_(0x80732012)
#define E_CORE_FIRST   E_LOCK_VIOLATION
#define E_CORE_LAST   E_NAMEMISSING
#define E_ATTVALTYPE   _HRESULT_TYPEDEF_(0x80733001)
#define E_META_NOTOPEN   _HRESULT_TYPEDEF_(0x80733002)
#define E_INVALID_PATH   _HRESULT_TYPEDEF_(0x80733003)
#define E_METAREF   _HRESULT_TYPEDEF_(0x80733004)
#define E_META_FIRST   E_ATTVALTYPE
#define E_META_LAST   E_METAREF
#define E_XMLPARSER   _HRESULT_TYPEDEF_(0x80734001)
#define E_INVALID_DTD   _HRESULT_TYPEDEF_(0x80734002)
#define E_INVALID_GUID   _HRESULT_TYPEDEF_(0x80734003)
#define E_INVALID_FILENAME   _HRESULT_TYPEDEF_(0x80734004)
#define E_INVALID_MGA   _HRESULT_TYPEDEF_(0x80734005)
#define E_INVALID_META   _HRESULT_TYPEDEF_(0x80734006)
#define E_TOOMANYPASSES   _HRESULT_TYPEDEF_(0x80734007)
#define E_INVALID_XML_LONG   _HRESULT_TYPEDEF_(0x80734008)
#define E_PARSER_FIRST   E_INVALID_DTD
#define E_PARSER_LAST   E_INVALID_XML_LONG
#define E_XSLT_XERCES_INIT   _HRESULT_TYPEDEF_(0x80734009)
#define E_XSLT_COMPILE_ERROR   _HRESULT_TYPEDEF_(0x8073400A)
#define E_XSLT_TRANSF_ERROR   _HRESULT_TYPEDEF_(0x8073400B)
#define E_XSLT_ERROR   _HRESULT_TYPEDEF_(0x8073400C)
#define E_XSLTFILESEL_USER_ABORTED   _HRESULT_TYPEDEF_(0x8073400D)

Functions

bool CheckOut_IsBound (BSTR b)
bool CheckOut_IsBound (const VARIANT &v)
bool CheckOut_IsBound (const IUnknown *p)
bool CheckOut_IsBound (const int)
bool CheckOut_IsBound (const short)
bool CheckOut_IsBound (const ULONG)
bool CheckOut_IsBound (const SAFEARRAY *p)
void throw_com_error (HRESULT hr, LPCOLESTR desc)
void throw_last_com_error (HRESULT hr)
void SetErrorInfo (LPCOLESTR desc) throw ()
void SetErrorInfo (HRESULT hr, LPOLESTR desc2=NULL) throw ()
bool GetErrorInfo (BSTR *p) throw ()
void GetErrorInfo (HRESULT hr, BSTR *p) throw ()
static void SetStandardOrGMEErrorInfo (HRESULT hr) throw ()

Define Documentation

#define CATCH_CMEMORY_EXCEPTION (   CLEANUP)

Definition at line 69 of file CommonError.h.

#define CHECK_IN (   PTR)
Value:
{ \
        if( PTR == NULL ) \
                COMRETURN(E_INVALIDARG) \
}

Definition at line 115 of file CommonError.h.

#define CHECK_INOUT (   PTR)
Value:
{ \
        if( PTR == NULL ) \
                COMRETURN(E_INVALIDARG) \
}

Definition at line 129 of file CommonError.h.

#define CHECK_OUT (   PTR)
Value:
{ \
        if( PTR == NULL ) \
                COMRETURN(E_POINTER) \
        else if( CheckOut_IsBound(*PTR) ) \
                COMRETURN(E_OUT_NOT_EMPTY) \
}

Definition at line 121 of file CommonError.h.

#define COMCATCH (   CLEANUP)
Value:
catch(hresult_exception &e) \
        { \
                ASSERT( FAILED(e.hr) ); \
                { CLEANUP; } \
                SetStandardOrGMEErrorInfo(e.hr); \
                return e.hr; \
        } \
        catch(_com_error &e) \
        { \
                { CLEANUP; } \
                if (e.Description() != _bstr_t()) \
                        SetErrorInfo(e.Description()); \
		else \
			SetStandardOrGMEErrorInfo(e.Error()); \
                return e.Error(); \
        } \
        catch (const std::bad_alloc& ) \
        { \
                try { CLEANUP; } catch (const std::bad_alloc& ) { } \
                SetStandardOrGMEErrorInfo(E_OUTOFMEMORY); \
                return E_OUTOFMEMORY; \
        } \
    CATCH_CMEMORY_EXCEPTION(CLEANUP) \
        return S_OK;

Definition at line 73 of file CommonError.h.

#define COMRETURN (   HR)
Value:
{ \
                HRESULT _hr = HR; \
                if( FAILED(_hr) ) \
                        SetErrorInfo(_hr); \
                return _hr; \
        }

Definition at line 99 of file CommonError.h.

#define COMTHROW (   FUNC)
Value:
do { \
        HRESULT _hr = (FUNC); \
        if( FAILED(_hr) ) { \
                throw hresult_exception(_hr); \
        } \
} while(false)

Definition at line 34 of file CommonError.h.

#define COMTRY   try

Definition at line 57 of file CommonError.h.

#define COMVERIFY (   FUNC)    VERIFY(SUCCEEDED(FUNC))

Definition at line 49 of file CommonError.h.

#define E_ATTRID   _HRESULT_TYPEDEF_(0x80732003)

Definition at line 203 of file CommonError.h.

#define E_ATTVALTYPE   _HRESULT_TYPEDEF_(0x80733001)

Definition at line 257 of file CommonError.h.

#define E_BINFILE   _HRESULT_TYPEDEF_(0x80732011)

Definition at line 245 of file CommonError.h.

Definition at line 191 of file CommonError.h.

Definition at line 192 of file CommonError.h.

#define E_COMTHROW_TEST   _HRESULT_TYPEDEF_(0x8073100A)

Definition at line 188 of file CommonError.h.

#define E_CONVERSION   _HRESULT_TYPEDEF_(0x80731003)

Definition at line 167 of file CommonError.h.

Definition at line 251 of file CommonError.h.

#define E_CORE_LAST   E_NAMEMISSING

Definition at line 252 of file CommonError.h.

#define E_EXCEPTION   _HRESULT_TYPEDEF_(0x80731002)

Definition at line 164 of file CommonError.h.

#define E_FILEOPEN   _HRESULT_TYPEDEF_(0x80731008)

Definition at line 182 of file CommonError.h.

#define E_GETALL   _HRESULT_TYPEDEF_(0x80731004)

Definition at line 170 of file CommonError.h.

#define E_INVALID_DTD   _HRESULT_TYPEDEF_(0x80734002)

Definition at line 278 of file CommonError.h.

#define E_INVALID_FILENAME   _HRESULT_TYPEDEF_(0x80734004)

Definition at line 284 of file CommonError.h.

#define E_INVALID_GUID   _HRESULT_TYPEDEF_(0x80734003)

Definition at line 281 of file CommonError.h.

#define E_INVALID_LOCK_VALUE   _HRESULT_TYPEDEF_(0x80732002)

Definition at line 200 of file CommonError.h.

#define E_INVALID_META   _HRESULT_TYPEDEF_(0x80734006)

Definition at line 290 of file CommonError.h.

#define E_INVALID_MGA   _HRESULT_TYPEDEF_(0x80734005)

Definition at line 287 of file CommonError.h.

#define E_INVALID_PATH   _HRESULT_TYPEDEF_(0x80733003)

Definition at line 263 of file CommonError.h.

#define E_INVALID_USAGE   _HRESULT_TYPEDEF_(0x80731001)

Definition at line 161 of file CommonError.h.

#define E_INVALID_XML_LONG   _HRESULT_TYPEDEF_(0x80734008)

Definition at line 296 of file CommonError.h.

#define E_LOCK_VIOLATION   _HRESULT_TYPEDEF_(0x80732001)

Definition at line 197 of file CommonError.h.

#define E_META_FIRST   E_ATTVALTYPE

Definition at line 269 of file CommonError.h.

#define E_META_LAST   E_METAREF

Definition at line 270 of file CommonError.h.

#define E_META_NOTOPEN   _HRESULT_TYPEDEF_(0x80733002)

Definition at line 260 of file CommonError.h.

#define E_METAID   _HRESULT_TYPEDEF_(0x80732004)

Definition at line 206 of file CommonError.h.

#define E_METAPROJECT   _HRESULT_TYPEDEF_(0x80732005)

Definition at line 209 of file CommonError.h.

#define E_METAREF   _HRESULT_TYPEDEF_(0x80733004)

Definition at line 266 of file CommonError.h.

#define E_NAMEMISSING   _HRESULT_TYPEDEF_(0x80732012)

Definition at line 248 of file CommonError.h.

#define E_NONEMPTY_COLL   _HRESULT_TYPEDEF_(0x8073200F)

Definition at line 239 of file CommonError.h.

#define E_NOTFOUND   _HRESULT_TYPEDEF_(0x80731007)

Definition at line 179 of file CommonError.h.

#define E_NOTLOCKED   _HRESULT_TYPEDEF_(0x8073200D)

Definition at line 233 of file CommonError.h.

#define E_OBJECTEXISTS   _HRESULT_TYPEDEF_(0x8073200B)

Definition at line 227 of file CommonError.h.

#define E_OUT_NOT_EMPTY   _HRESULT_TYPEDEF_(0x80731005)

Definition at line 173 of file CommonError.h.

Definition at line 299 of file CommonError.h.

Definition at line 300 of file CommonError.h.

#define E_PROJECT_MISMATCH   _HRESULT_TYPEDEF_(0x80732007)

Definition at line 215 of file CommonError.h.

#define E_REPOSITORY   _HRESULT_TYPEDEF_(0x80732006)

Definition at line 212 of file CommonError.h.

#define E_REPOSITORY_DATA   _HRESULT_TYPEDEF_(0x8073200E)

Definition at line 236 of file CommonError.h.

#define E_SAMEPROJECT   _HRESULT_TYPEDEF_(0x80731006)

Definition at line 176 of file CommonError.h.

#define E_TERRITORY   _HRESULT_TYPEDEF_(0x8073200C)

Definition at line 230 of file CommonError.h.

#define E_TOOMANYPASSES   _HRESULT_TYPEDEF_(0x80734007)

Definition at line 293 of file CommonError.h.

#define E_TRANSACTION   _HRESULT_TYPEDEF_(0x8073200A)

Definition at line 224 of file CommonError.h.

#define E_UNKNOWN_STORAGE   _HRESULT_TYPEDEF_(0x80732010)

Definition at line 242 of file CommonError.h.

#define E_VALTYPE   _HRESULT_TYPEDEF_(0x80732009)

Definition at line 221 of file CommonError.h.

#define E_VERIFY   _HRESULT_TYPEDEF_(0x80731009)

Definition at line 185 of file CommonError.h.

#define E_XMLPARSER   _HRESULT_TYPEDEF_(0x80734001)

Definition at line 275 of file CommonError.h.

#define E_XSLT_COMPILE_ERROR   _HRESULT_TYPEDEF_(0x8073400A)

Definition at line 304 of file CommonError.h.

#define E_XSLT_ERROR   _HRESULT_TYPEDEF_(0x8073400C)

Definition at line 306 of file CommonError.h.

#define E_XSLT_TRANSF_ERROR   _HRESULT_TYPEDEF_(0x8073400B)

Definition at line 305 of file CommonError.h.

#define E_XSLT_XERCES_INIT   _HRESULT_TYPEDEF_(0x80734009)

Definition at line 303 of file CommonError.h.

#define E_XSLTFILESEL_USER_ABORTED   _HRESULT_TYPEDEF_(0x8073400D)

Definition at line 307 of file CommonError.h.

#define E_ZOMBIE   _HRESULT_TYPEDEF_(0x80732008)

Definition at line 218 of file CommonError.h.

#define HR_THROW (   _hr)
Value:
do { \
        throw hresult_exception(_hr); \
} while(false)

Definition at line 52 of file CommonError.h.

#define NOTHROW   throw()

Definition at line 32 of file CommonError.h.

#define VERIFYTHROW (   FUNC)
Value:
do { \
        if( !(bool)(FUNC) ) { \
                throw hresult_exception(E_VERIFY); \
        } \
} while(false)

Definition at line 42 of file CommonError.h.


Function Documentation

bool CheckOut_IsBound ( BSTR  b) [inline]

Definition at line 107 of file CommonError.h.

bool CheckOut_IsBound ( const VARIANT &  v) [inline]

Definition at line 108 of file CommonError.h.

bool CheckOut_IsBound ( const IUnknown *  p) [inline]

Definition at line 109 of file CommonError.h.

bool CheckOut_IsBound ( const int  ) [inline]

Definition at line 110 of file CommonError.h.

bool CheckOut_IsBound ( const short  ) [inline]

Definition at line 111 of file CommonError.h.

bool CheckOut_IsBound ( const ULONG  ) [inline]

Definition at line 112 of file CommonError.h.

bool CheckOut_IsBound ( const SAFEARRAY *  p) [inline]

Definition at line 113 of file CommonError.h.

bool GetErrorInfo ( BSTR *  p) throw ()

Definition at line 226 of file CommonError.cpp.

void GetErrorInfo ( HRESULT  hr,
BSTR *  p 
) throw ()

Definition at line 246 of file CommonError.cpp.

void SetErrorInfo ( LPCOLESTR  desc) throw ()

Definition at line 140 of file CommonError.cpp.

void SetErrorInfo ( HRESULT  hr,
LPOLESTR  desc2 = NULL 
) throw ()

Definition at line 193 of file CommonError.cpp.

static void SetStandardOrGMEErrorInfo ( HRESULT  hr) throw () [static]

Definition at line 144 of file CommonError.h.

void throw_com_error ( HRESULT  hr,
LPCOLESTR  desc 
)

Definition at line 104 of file CommonError.cpp.

void throw_last_com_error ( HRESULT  hr)

Definition at line 127 of file CommonError.cpp.