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
// ObjectWindows
3
// Copyright (c) 1993, 1996 by Borland International, All Rights Reserved
4
//
5
/// \file
6
/// ObjectWindows exception class & function definitions
7
//----------------------------------------------------------------------------
8
9
#if !defined(OWL_EXCEPT_H)
10
#define OWL_EXCEPT_H
11
12
#include <
owl/private/defs.h
>
13
#if defined(BI_HAS_PRAGMA_ONCE)
14
# pragma once
15
#endif
16
17
#include <
owl/private/except.h
>
18
#include <
owl/exbase.h
>
19
#include <
owl/private/gmodule.h
>
20
#include <owl/except.rh>
21
22
namespace
owl
{
23
24
#include <
owl/preclass.h
>
25
26
27
//
28
// Global function to handle exceptions in OWL as a last resort
29
//
30
_OWLFUNC
(
int
)
HandleGlobalException
(owl::TXBase& x, LPCTSTR caption, LPCTSTR canResume=
nullptr
);
31
32
/// \addtogroup except
33
/// @{
34
/// \class TXOwl
35
// ~~~~~ ~~~~~
36
/// TXOwl is root class of the ObjectWindows exception hierarchy.
37
//
38
class
_OWLCLASS
TXOwl
:
public
TXBase
{
39
public
:
40
TXOwl
(
const
tstring
& msg,
uint
resId = 0);
41
TXOwl
(
uint
resId,
TModule
* module = &
GetGlobalModule
());
42
virtual
~TXOwl
();
43
44
// Override TXBase's virtuals
45
//
46
TXOwl
*
Clone
();
47
void
Throw
();
48
49
/// Per-exception class unhandled-handler, will default to the per-module
50
/// unhandled-handler
51
//
52
virtual
int
Unhandled
(
TModule
* appModule,
uint
promptResId);
53
54
uint
GetErrorCode
()
const
;
55
56
static
tstring
ResourceIdToString
(
bool
* found,
uint
resId,
57
TModule
* module = &
GetGlobalModule
());
58
static
tstring
MakeMessage
(
uint
resId,
const
tstring
& infoStr,
TModule
* module = &
GetGlobalModule
());
59
static
tstring
MakeMessage
(
uint
resId, LPCTSTR infoStr,
TModule
* module = &
GetGlobalModule
());
60
#if defined(UNICODE)
61
static
tstring
MakeMessage
(
uint
resId, LPCSTR infoStr,
TModule
* module = &
GetGlobalModule
());
62
#endif
63
static
tstring
MakeMessage
(
uint
resId,
uint
infoNum,
TModule
* module = &
GetGlobalModule
());
64
65
static
void
Raise
(
const
tstring
& msg,
uint
resId = 0);
66
static
void
Raise
(
uint
resId,
TModule
* module = &
GetGlobalModule
());
67
68
public
:
69
/// Resource ID for a TXOwl object.
70
uint
ResId
;
71
};
72
73
//
74
/// \class TXOutOfMemory
75
// ~~~~~ ~~~~~~~~~~~~~
76
/// Describes an exception that results from running out of memory.
77
//
78
class
_OWLCLASS
TXOutOfMemory
:
public
TXOwl
{
79
public
:
80
TXOutOfMemory
();
81
82
TXOutOfMemory
*
Clone
();
83
void
Throw
();
84
85
static
void
Raise
();
86
};
87
88
//
89
/// \class TXNotSupportedCall
90
// ~~~~~ ~~~~~~~~~~~~~~~~~~
91
class
_OWLCLASS
TXNotSupportedCall
:
public
TXOwl
{
92
public
:
93
TXNotSupportedCall
();
94
95
TXNotSupportedCall
*
Clone
();
96
void
Throw
();
97
98
static
void
Raise
();
99
};
100
101
102
//
103
/// \class TXEndSession
104
// ~~~~~ ~~~~~~~~~~~~
105
/// TXEndSession is thrown from TWindow's handler for WM_ENDSESSION.
106
/// Since it is not derived from TXOwl, it does not fall into the same
107
/// catch handler.
108
/// It is used exclusively for shutting down the application.
109
//
110
111
class
_OWLCLASS_RTL
TXEndSession
{
112
public
:
113
TXEndSession
() {}
114
};
115
116
117
118
#include <
owl/posclass.h
>
119
120
//
121
/// Returns the resource ID.
122
//
123
inline
uint
TXOwl::GetErrorCode
()
const
{
124
return
ResId
;
125
}
126
127
}
// OWL namespace
128
129
130
#endif
// OWL_EXCEPT_H
owl::TModule
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Definition
module.h:78
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.
gmodule.h
owl::TXOutOfMemory::TXOutOfMemory
TXOutOfMemory()
Constructs a TXOutOfMemory object.
Definition
except.cpp:266
owl::TXOwl::Throw
void Throw()
Throws the exception object.
Definition
except.cpp:171
owl::TXOwl::GetErrorCode
uint GetErrorCode() const
Returns the resource ID.
Definition
except.h:123
owl::TXNotSupportedCall::Raise
static void Raise()
Definition
except.cpp:317
owl::TXOwl::ResId
uint ResId
Resource ID for a TXOwl object.
Definition
except.h:70
owl::TXOutOfMemory::Raise
static void Raise()
Construct a TXOutOfMemory exception from scratch, and throw it.
Definition
except.cpp:292
owl::TXOwl::Raise
static void Raise(const tstring &msg, uint resId=0)
Definition
except.cpp:181
owl::TXOwl::MakeMessage
static tstring MakeMessage(uint resId, const tstring &infoStr, TModule *module=&GetGlobalModule())
Definition
except.cpp:233
owl::TXOwl::ResourceIdToString
static tstring ResourceIdToString(bool *found, uint resId, TModule *module=&GetGlobalModule())
Static member function used to convert a resource id to a 'string'.
Definition
except.cpp:204
owl::TXOwl::TXOwl
TXOwl(const tstring &msg, uint resId=0)
An OWL exception with a given message for displaying and an unsigned Id that can be used for identifi...
Definition
except.cpp:123
owl::TXOutOfMemory::Throw
void Throw()
Throws the exception object.
Definition
except.cpp:283
owl::TXEndSession::TXEndSession
TXEndSession()
Definition
except.h:113
owl::TXOutOfMemory::Clone
TXOutOfMemory * Clone()
Definition
except.cpp:273
owl::TXOwl::Clone
TXOwl * Clone()
Definition
except.cpp:161
owl::TXNotSupportedCall::TXNotSupportedCall
TXNotSupportedCall()
Definition
except.cpp:299
owl::TXNotSupportedCall::Throw
void Throw()
Definition
except.cpp:312
owl::TXNotSupportedCall::Clone
TXNotSupportedCall * Clone()
Definition
except.cpp:306
owl::TXOwl::Unhandled
virtual int Unhandled(TModule *appModule, uint promptResId)
Per-exception class unhandled-handler, will default to the per-module unhandled-handler.
Definition
except.cpp:155
owl
Object Windows Library (OWLNext Core).
Definition
animctrl.h:22
owl::HandleGlobalException
int HandleGlobalException(owl::TXBase &x, LPCTSTR caption, LPCTSTR canResume=nullptr)
Definition
except.cpp:29
owl::tstring
std::string tstring
Definition
defs.h:79
owl::uint
unsigned int uint
Definition
number.h:25
owl::GetGlobalModule
TModule & GetGlobalModule()
Definition
global.cpp:48
defs.h
_OWLFUNC
#define _OWLFUNC(p)
Definition
defs.h:341
_OWLCLASS
#define _OWLCLASS
Definition
defs.h:338
_OWLCLASS_RTL
#define _OWLCLASS_RTL
Definition
defs.h:339
except.h
posclass.h
preclass.h
include
owl
except.h
Generated by
1.18.0