OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
Loading...
Searching...
No Matches
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
26
namespace
ocf
{
27
28
//
29
/// \class TXOle
30
// ~~~~~ ~~~~~
31
/// OLE API related exception object
32
//
33
class
_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
57
inline
58
TXOle::TXOle
(
const
owl::tstring
& msg, HRESULT stat)
59
:
owl
::
TXBase
(msg),
Stat
((long)stat)
60
{}
61
62
//
63
//
64
//
65
inline
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
90
class
_OCFCLASS
TXObjComp
:
public
TXOle
{
91
public
:
92
enum
TError
{
93
94
// Application Errors
95
//
96
xNoError
,
97
xBOleLoadFail
,
98
xBOleVersFail
,
99
xBOleBindFail
,
100
xDocFactoryFail
,
101
102
// Doc & Part Errors
103
//
104
xMissingRootIStorage
,
105
xInternalPartError
,
106
xPartInitError
,
107
108
// Storage Errors
109
//
110
xRootStorageOpenError
,
111
xStorageOpenError
,
112
xStorageILockError
,
113
xStreamOpenError
,
114
};
115
116
TXObjComp
(
TError
err,
const
owl::tstring
& msg, HRESULT stat =
HR_FAIL
)
117
:
TXOle
(msg, stat),
ErrorCode
(err) {}
118
TXObjComp
(
const
TXObjComp
& src)
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
128
const
TError
ErrorCode
;
129
};
130
# if defined(BI_COMP_BORLANDC)
131
# pragma warn .inl
132
# endif
133
134
}
// OCF namespace
135
136
#endif
// OCF_EXCEPT_H
ocf::TXObjComp
Base OC exception class.
Definition
except.h:90
ocf::TXObjComp::TError
TError
Definition
except.h:92
ocf::TXObjComp::xDocFactoryFail
@ xDocFactoryFail
Definition
except.h:100
ocf::TXObjComp::xRootStorageOpenError
@ xRootStorageOpenError
Definition
except.h:110
ocf::TXObjComp::xMissingRootIStorage
@ xMissingRootIStorage
Definition
except.h:104
ocf::TXObjComp::xBOleLoadFail
@ xBOleLoadFail
Definition
except.h:97
ocf::TXObjComp::xPartInitError
@ xPartInitError
Definition
except.h:106
ocf::TXObjComp::xStorageILockError
@ xStorageILockError
Definition
except.h:112
ocf::TXObjComp::xBOleVersFail
@ xBOleVersFail
Definition
except.h:98
ocf::TXObjComp::xNoError
@ xNoError
Definition
except.h:96
ocf::TXObjComp::xBOleBindFail
@ xBOleBindFail
Definition
except.h:99
ocf::TXObjComp::xStorageOpenError
@ xStorageOpenError
Definition
except.h:111
ocf::TXObjComp::xInternalPartError
@ xInternalPartError
Definition
except.h:105
ocf::TXObjComp::xStreamOpenError
@ xStreamOpenError
Definition
except.h:113
ocf::TXObjComp::TXObjComp
TXObjComp(const TXObjComp &src)
Definition
except.h:118
ocf::TXObjComp::TXObjComp
TXObjComp(TError err, const owl::tstring &msg, HRESULT stat=HR_FAIL)
Definition
except.h:116
ocf::TXObjComp::ErrorCode
const TError ErrorCode
Definition
except.h:128
ocf::TXOle::Check
static void Check(HRESULT stat, LPCTSTR msg)
Definition
except.cpp:47
ocf::TXOle::TXOle
TXOle(const owl::tstring &msg, HRESULT stat)
Definition
except.h:58
ocf::TXOle::OleErrorFromCode
static void OleErrorFromCode(HRESULT stat, TCHAR *buffer, int size)
Definition
except.cpp:84
ocf::TXOle::Stat
const long Stat
Definition
except.h:48
ocf::TXOle::Throw
void Throw()
Definition
except.cpp:38
ocf::TXOle::Clone
TXOle * Clone()
Definition
except.cpp:29
owl::TXBase
Derived from xmsg, TXBase is the base class for ObjectWindows and ObjectComponents exception-handling...
Definition
exbase.h:41
owl::TXBase::TXBase
TXBase(const tstring &msg)
Calls the xmsg class's constructor that takes a string parameter and initializes xmsg with the value ...
Definition
exbase.cpp:121
exbase.h
Base exception support for framework exceptions.
ocf
Object Component Framework (COM encapsulation).
Definition
appdesc.h:22
owl
Object Windows Library (OWLNext Core).
Definition
animctrl.h:22
owl::tstring
std::string tstring
Definition
defs.h:79
defs.h
ObjectComponents fundamental definitions.
_OCFCLASS
#define _OCFCLASS
Definition
defs.h:45
HR_FAIL
#define HR_FAIL
Definition
defs.h:83
ole2inc.h
defs.h
include
ocf
except.h
Generated by
1.18.0