CBS_UserException Class Reference

An Exception class for user defined exceptions. More...

Inheritance diagram for CBS_UserException:

Inheritance graph
[legend]
Collaboration diagram for CBS_UserException:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CBS_UserException (LPCTSTR lpFileName, UINT uiLine, LPCTSTR lpWhat)
virtual void FreeResources (BOOL bFromDestructor=FALSE)
virtual DWORD GetErrorMessage (LPTSTR lpMessage, DWORD dwBufLen)
virtual CBS_Trace::BS_TRACE_MODE GetTraceOutput ()
virtual BOOL IsContinuable ()
void SetContinuable (BOOL bContinuable)
virtual ~CBS_UserException ()

Detailed Description

An Exception class for user defined exceptions.

Author:
Dror Otmi
Date:
12.07.2003
Version:
V 1.0 Initial version This class is designed for user exception. As an input it expect an application a description of the exception. This input will be formatted into the exception report when the exception is caught and CBS_Exception::ReportError() is invoked.


Constructor & Destructor Documentation

CBS_UserException::CBS_UserException LPCTSTR  lpFileName,
UINT  uiLine,
LPCTSTR  lpWhat
 

Constructor. The application should use the macro THROW_ExUser( lpWhat ) when it throws a user exception.

Parameters:
lpFileName The file in which the exception was thrown.
uiLine The line in lpFileName.
lpWhat What is the reason for the exception.

CBS_UserException::~CBS_UserException  )  [virtual]
 

Destructor.


Member Function Documentation

void CBS_UserException::FreeResources BOOL  bFromDestructor = FALSE  )  [virtual]
 

Frees the resources allocated by the current object.

Parameters:
bFromDestructor FALSE by default, the application should never call this function with this argument set to TRUE.
Returns:
Nothing.

Reimplemented from CBS_Exception.

DWORD CBS_UserException::GetErrorMessage LPTSTR  lpMessage,
DWORD  dwBufLen
[virtual]
 

Formats a string that describes the exception associated with the current object. The formatted string is built from lpWhat (passed to the constructor) and the file name. For example throwing the macro THROW_ExUser( "Bad argument" ) from C:\MyTestFile.cpp at line 289 will format the following string:
"User Exception Handler caught the following exception:
C:\MyTestFile.cpp (289) : Bad argument"

Parameters:
lpMessage A buffer into which the formatted message will be copied.
dwBufLen The length in bytes of lpMessage.
Returns:
The number of bytes needed for the whole message. If dwBufLen is smaller then the number of bytes needed, nothing is copied to lpMessage.

Reimplemented from CBS_Exception.

CBS_Trace::BS_TRACE_MODE CBS_UserException::GetTraceOutput  )  [virtual]
 

See return.

Returns:
The trace error level CBS_Trace::BS_REPORT_USER_EXCEPTION_INFO.

Reimplemented from CBS_Exception.

BOOL CBS_UserException::IsContinuable  )  [virtual]
 

See return.

Returns:
TRUE if the exception is Continuable.

Reimplemented from CBS_Exception.

void CBS_UserException::SetContinuable BOOL  bContinuable  ) 
 

Sets the continuable flag to the exception object.

Parameters:
bContinuable TRUE if continuable (the default) and FALSE if not.
Returns:
Nothing.
Bitspot AG


Bitspot AG
Rietlistrasse 1
CH-6345 Neuheim

Bitspot AG Logo

Phone:

+41 41 755 11 22

Fax:

+41 41 755 11 31

e-mail:

mail@bitspot.com

Web:

www.bitspot.com