Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

AxPipe::Assert Namespace Reference

Some assert-definintions, and a debug-printf using a MessageBox. More...


Functions

const _TCHAR * LastErrorMsg ()
void AssFunc (bool fOk, const _TCHAR *sz, const _TCHAR *szFile, int iLine)
 Display formatted message on failed assertion and exit.

void MessageBoxF (HWND hWnd, const _TCHAR *szFmt, const _TCHAR *szCaption, UINT uType,...)
 A MessageBox() with printf() functionality.

void OutputDebugStringF (const _TCHAR *szFmt,...)
 A OutputDebugString() with printf() functionality.


Detailed Description

Some assert-definintions, and a debug-printf using a MessageBox.

Use asserts where you want to assert(sic!) a condition, and if it it's not ok, there's no use to continue execution. All Ass* 'functions' here will exit() after displaying a message - so this is for fatal errors, such as internal inconstencies, end of memory conditions, unexpected and un-manageable Win32-API returns etc.

Macros ASSCHK, ASSAPI and ASSPTR are used to actually call the function so as to get the correct file and line into the message produced.


Function Documentation

void AxPipe::Assert::AssFunc bool  fOk,
const _TCHAR *  sz,
const _TCHAR *  szFile,
int  iLine
 

Display formatted message on failed assertion and exit.

If the an assertion fails, format and display a message instead before exiting.

Parameters:
fOk The assertion, if true nothing happens.
sz The message to display.
szFile The module name where the assertion is done.
iLine The line number in the module where the assertion is done.

Definition at line 58 of file AxPipeAssert.cpp.

References _T, and MessageBoxF().

const _TCHAR * AxPipe::Assert::LastErrorMsg  ) 
 

Get the 'raw' message definition from the system, based on LastError.

Returns:
a pointer to a static buffer (and shut off warning about same).

Definition at line 38 of file AxPipeAssert.cpp.

References _T, and _TCHAR.

void AxPipe::Assert::MessageBoxF HWND  hWnd,
const _TCHAR *  szFmt,
const _TCHAR *  szCaption,
UINT  uType,
... 
 

A MessageBox() with printf() functionality.

MessageBox() with printf() functionality

Parameters:
hWnd Handle to owner window of message box or NULL
szFmt a printf() format string
szCaption the message box caption
uType The message box type, i.e. MB_OK etc

Definition at line 71 of file AxPipeAssert.cpp.

References _TCHAR.

Referenced by AssFunc().


Generated on Mon Feb 2 13:19:29 2004 for AxPipe by doxygen 1.3.5