Listing 3: main.cpp Test application
//================================================================== // Main.cpp // Force debug breakpoint test application // Bret S. Pehrson for Windows Developer's Journal (12.23.98) //================================================================== /* disable unnecessary level-4 warnings */ #pragma warning(disable : 4201) //nameless struct/union #pragma warning(disable : 4214) //bit field types other than int #pragma warning(disable : 4514) //unreferenced inline function /* include files */ #define WIN32_LEAN_AND_MEAN #include <windows.h> #include <tchar.h> #include "FDbgBrk.h" /* required link libraries */ #pragma comment(lib, "kernel32") #pragma comment(lib, "user32") #pragma comment(lib, "advapi32") //------------------------------------------------------------------ //WinMain() //------------------------------------------------------------------ int WINAPI WinMain( HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int /*nCmdShow*/) { /* TEMPORARY VARIABLES */ int nResult = 0; /* attempt force debug break */ try { nResult = MessageBox( NULL, TEXT("Press OK to force a debug break or " "Cancel for DebugBreak()"), TEXT("Force Debug Break"), MB_ICONQUESTION|MB_OKCANCEL); if (nResult == IDOK) { ForceDebugBreak(); } else { DebugBreak(); } } catch (...) { } /* done */ return 0; } /* End of file */