home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tricks of the Windows Gam…ming Gurus (2nd Edition)
/
Disc2.iso
/
msdn_vcb
/
samples
/
vc98
/
sdk
/
graphics
/
directx
/
dsstream
/
wassert.c
< prev
next >
Wrap
C/C++ Source or Header
|
1997-07-14
|
1KB
|
46 lines
/*==========================================================================
*
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
*
* File: wassert.c
* Content: Windows assert handler
* You must externally define hWndMain and szAppName for this
* to work.
*
***************************************************************************/
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
extern HWND hWndMain;
extern char szAppName[];
#include "wassert.h"
#ifdef WASSERT
void AssertFail(char szErr[], char szFileName[], int nLine, char szMessage[])
{
char szT[256];
if (szMessage != NULL)
wsprintf(szT, "Assert(%s);\nFile %s, line %d. %s", szErr, szFileName, nLine, szMessage);
else
wsprintf(szT, "Assert(%s);\nFile %s, line %d.", szErr, szFileName, nLine);
switch (MessageBox(hWndMain, szT, szAppName, MB_ABORTRETRYIGNORE | MB_ICONSTOP | MB_APPLMODAL))
{
case IDABORT:
SendMessage(hWndMain, WM_CLOSE, 0, 0);
case IDRETRY:
_asm int 3;
// Fall Through //
case IDIGNORE:
break;
} // switch
} // AssertFail
#endif // ASSERT