Reporting Fatal Errors

The FatalError function displays a message box to report an error message and then destroys the window. The function does not perform any clean-up; this is done when the application receives the WM_DESTROY message sent by the DestroyWindow function.

static void 
FatalError(HWND hwnd, int nMessage, HRESULT hRes) 
{ 
    ReportError(hwnd, nMessage, hRes); 
    fSuspended = TRUE; 
 
    DestroyWindow(hwnd); 
}