OWLNext    7.0
Borland's Object Windows Library for the modern age
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
except.h
Go to the documentation of this file.
1//----------------------------------------------------------------------------
2// ObjectComponents
3// Copyright (c) 1994, 1996 by Borland International, All Rights Reserved
4/// \file
5/// OCF Exception classes
6/// \note All OCF Exception classes are defined here except for TXAuto,
7/// the exception used in automation failures. [See AUTODEFS.H
8/// for TXAuto].
9//----------------------------------------------------------------------------
10
11#if !defined(OCF_EXCEPT_H)
12#define OCF_EXCEPT_H
13
14#include <owl/private/defs.h>
15#if defined(BI_HAS_PRAGMA_ONCE)
16# pragma once
17#endif
18
19#include <ocf/defs.h>
20#include <owl/exbase.h>
21
22#include <ocf/defs.h>
23#include <owl/private/ole2inc.h>
24
25
26namespace ocf {
27
28//
29/// \class TXOle
30// ~~~~~ ~~~~~
31/// OLE API related exception object
32//
33class _OCFCLASS TXOle : public owl::TXBase {
34 public:
35 TXOle(const owl::tstring& msg, HRESULT stat);
36 TXOle(const TXOle& src);
37
38 ~TXOle();
39
40 TXOle* Clone();
41 void Throw();
42
43 static void Check(HRESULT stat, LPCTSTR msg);
44 static void Check(HRESULT stat);
45 static void Throw(HRESULT stat, LPCTSTR msg);
46 static void OleErrorFromCode(HRESULT stat, LPTSTR buffer, int size);
47
48 const long Stat;
49};
50
51//
52//
53//
54# if defined(BI_COMP_BORLANDC)
55# pragma warn -inl
56# endif
57inline
59 : owl::TXBase(msg), Stat((long)stat)
60{}
61
62//
63//
64//
65inline TXOle::TXOle(const TXOle& src)
66 : owl::TXBase(src), Stat(src.Stat)
67{}
68# if defined(BI_COMP_BORLANDC)
69# pragma warn .inl
70# endif
71
72//
73// Macro to simply error checking of OLE calls
74//
75#if (__DEBUG > 0) || defined(__WARN)
76# define OLECALL(func, msg) TXOle::Check(func, msg)
77#else
78# define OLECALL(func, msg) TXOle::Check(func)
79#endif
80
81
82//
83/// \class TXObjComp
84// ~~~~~ ~~~~~~~~~
85/// Base OC exception class
86//
87# if defined(BI_COMP_BORLANDC)
88# pragma warn -inl
89# endif
90class _OCFCLASS TXObjComp : public TXOle {
91 public:
115
117 : TXOle(msg, stat), ErrorCode(err) {}
119 : TXOle(src), ErrorCode(src.ErrorCode) {}
120 ~TXObjComp();
121
122 TXObjComp* Clone();
123 void Throw();
124
125 static void Check(HRESULT stat, TError err, LPCTSTR msg = 0);
126 static void Throw(TError err, HRESULT stat = HR_FAIL, LPCTSTR msg = 0);
127
129};
130# if defined(BI_COMP_BORLANDC)
131# pragma warn .inl
132# endif
133
134} // OCF namespace
135
136#endif // OCF_EXCEPT_H
Base OC exception class.
Definition except.h:90
@ xRootStorageOpenError
Definition except.h:110
@ xMissingRootIStorage
Definition except.h:104
@ xStorageILockError
Definition except.h:112
@ xStorageOpenError
Definition except.h:111
@ xInternalPartError
Definition except.h:105
TXObjComp(const TXObjComp &src)
Definition except.h:118
TXObjComp(TError err, const owl::tstring &msg, HRESULT stat=HR_FAIL)
Definition except.h:116
const TError ErrorCode
Definition except.h:128
OLE API related exception object.
Definition except.h:33
TXOle(const owl::tstring &msg, HRESULT stat)
Definition except.h:58
const long Stat
Definition except.h:48
Derived from xmsg, TXBase is the base class for ObjectWindows and ObjectComponents exception-handling...
Definition exbase.h:41
Base exception support for framework exceptions.
Object Component Framework (COM encapsulation)
Definition appdesc.h:22
Object Windows Library (OWLNext Core)
Definition animctrl.h:22
std::string tstring
Definition defs.h:79
ObjectComponents fundamental definitions.
#define _OCFCLASS
Definition defs.h:45
#define HR_FAIL
Definition defs.h:83