00001 #pragma once 00002 #ifndef _AXPIPEASSERT 00003 #define _AXPIPEASSERT 00004 00034 #ifndef ASSCHK 00038 #define ASSCHK(fOk, sz) AxPipe::Assert::AssFunc(fOk, sz, _T(__FILE__), __LINE__) 00039 #endif 00040 00041 #ifndef ASSAPI 00048 // Do the if to ensure that the condition is evaluted before the call to LastErrorMsg() 00049 #define ASSAPI(fOk) if ((fOk) != TRUE) AxPipe::Assert::AssFunc(false, AxPipe::Assert::LastErrorMsg(), _T(__FILE__), __LINE__) 00050 #endif 00051 00052 #ifndef ASSPTR 00055 #define ASSPTR(p) AxPipe::Assert::AssFunc((p) != NULL, _T("NULL pointer"), _T(__FILE__), __LINE__) 00056 #endif 00057 00058 namespace AxPipe { 00069 namespace Assert { 00070 extern const _TCHAR *LastErrorMsg(); 00071 00072 extern void AssFunc(bool fOk, const _TCHAR *sz, const _TCHAR *szFile, int iLine); 00074 extern void MessageBoxF(HWND hWnd, const _TCHAR *szFmt, const _TCHAR *szCaption, UINT uType, ...); 00075 #ifdef _DEBUG 00076 00077 extern void OutputDebugStringF(const _TCHAR *szFmt, ...); 00078 #else 00079 00080 inline void OutputDebugStringF(const _TCHAR *szFmt, ...) {} 00081 #endif 00082 } 00083 } 00084 00085 #endif _AXPIPEASSERT