31 static const tchar defCaption[] =
_T(
"Unhandled Exception");
32 static const tchar defError[] =
_T(
"Unknown Exception");
35 if (msg.length() == 0)
44 const int flags = MB_ICONSTOP | MB_TOPMOST | MB_TASKMODAL | (canResume ? MB_YESNO : MB_OK);
45 const int r = ::MessageBox(
nullptr, msg.c_str(), caption ? caption : defCaption, flags);
46 return (r == IDYES) ? 0 : -1;
157 return app->
Error(*
this, IDS_OWLEXCEPTION, promptResId);
163 return new TXOwl(*
this);
183 TXOwl(msg, resId).Throw();
192 TXOwl(resId, module).Throw();
208 bool status =
module && module->LoadString(resId, buf, COUNTOF(buf));
213 _stprintf(buf,
_T(
"Exception #%u (Could not load description string; <owl/except.rc> not bound?)."), resId);
235 return MakeMessage(resId, infoStr.c_str(), module);
268 TXOwl(IDS_OUTOFMEMORY)
301 TXOwl(IDS_NOTSUPPORTEDCALL)
ObjectWindows dynamic-link libraries (DLLs) construct an instance of TModule, which acts as an object...
Derived from xmsg, TXBase is the base class for ObjectWindows and ObjectComponents exception-handling...
TXBase(const tstring &msg)
Calls the xmsg class's constructor that takes a string parameter and initializes xmsg with the value ...
Describes an exception that results from running out of memory.
TXOwl is root class of the ObjectWindows exception hierarchy.
TXOutOfMemory()
Constructs a TXOutOfMemory object.
void Throw()
Throws the exception object.
uint ResId
Resource ID for a TXOwl object.
static void Raise()
Construct a TXOutOfMemory exception from scratch, and throw it.
static void Raise(const tstring &msg, uint resId=0)
static tstring MakeMessage(uint resId, const tstring &infoStr, TModule *module=&GetGlobalModule())
static tstring ResourceIdToString(bool *found, uint resId, TModule *module=&GetGlobalModule())
Static member function used to convert a resource id to a 'string'.
virtual ~TXOwl()
Destroys a TXOwl object.
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...
void Throw()
Throws the exception object.
TXNotSupportedCall * Clone()
virtual int Unhandled(TModule *appModule, uint promptResId)
Per-exception class unhandled-handler, will default to the per-module unhandled-handler.
virtual int Error(TXBase &x, uint captionResId, uint promptResId=0)
Replaceable exception handler; may be redefined to process OWL exceptions if canResume is false,...
Definition of class TModule.
Object Windows Library (OWLNext Core).
int HandleGlobalException(owl::TXBase &x, LPCTSTR caption, LPCTSTR canResume=nullptr)
ObjectWindows exception class & function definitions.
Base window class TWindow definition, including HWND encapsulation.