mirror of https://github.com/lianthony/NT4.0
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
693 B
38 lines
693 B
// ASSERT.cpp -- Assertion support code
|
|
|
|
#include "stdafx.h"
|
|
#include "Assert.h"
|
|
|
|
HWND hwndMain= NULL;
|
|
|
|
void SetMainWindow(HWND hwnd)
|
|
{
|
|
hwndMain= hwnd;
|
|
}
|
|
|
|
void AssertionFailure(PSZ pszFileName, int nLine)
|
|
{
|
|
char abMessage[513];
|
|
|
|
wsprintf(abMessage, "Assertion Failure on line %d of %s!", nLine, pszFileName);
|
|
|
|
int iResult= ::MessageBox(hwndMain, abMessage, "Assertion Failure!",
|
|
MB_ABORTRETRYIGNORE | MB_APPLMODAL | MB_ICONSTOP
|
|
);
|
|
|
|
switch(iResult)
|
|
{
|
|
case IDABORT:
|
|
|
|
ExitProcess(-nLine);
|
|
|
|
case IDRETRY:
|
|
|
|
DebugBreak();
|
|
break;
|
|
|
|
case IDIGNORE:
|
|
|
|
break;
|
|
}
|
|
}
|