Deriving from
TStandardException
Your own exception class, derived from
TStandardException
, must:
Define a public
enum
type with a value for each error specific to the exception.
Define a public constructor that takes an argument of the
enum
type and stores its value in the private member fData.
Override these
TStandardException
member functions:
The default constructor (takes no arguments)
The copy constructor
The assignment operator (operator=)
GetReason()--must return a value of the
enum
type; override as a public member function
Throw()--define this inline, substituting your exception class name:
Throw() {throw *(
exception-class-name
*)this;}
The destructor
[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995
Taligent
,Inc. All rights reserved.
Generated with
WebMaker