main - wxICON_ERROR return false bool OverlayDemo: try...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
#include "stdafx.h" #include "MainFrame.h" #include <Exception.h> # class OverlayDemo : public wxApp { public: bool OnInit(); bool OnExceptionInMainLoop(); }; } IMPLEMENT_APP(OverlayDemo) I bool OverlayDemo::OnInit() { try { ::wxHandleFatalExceptions(); ::wxInitAllImageHandlers(); wxXmlResource::Get()->InitAllHandlers(); if(!wxXmlResource::Get()->Load(wxT("OverlayDemo.xrc"))) { wxMessageBox(wxT("Failed to find the resource file: OverlayDemo.xrc"), wxT("Error"), wxOK | wxICON_ERROR); return false; } MainFrame* mainFrame = new MainFrame; SetTopWindow(mainFrame); mainFrame->Show(); m return true; } { wxMessageBox(wxString(e.what(), wxConvLibc), wxT("Error"), wxOK |
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: wxICON_ERROR); return false; } } bool OverlayDemo::OnExceptionInMainLoop() { try { throw; // Re-throw } catch(const DirectX::Exception& e) { const wxString message = wxString() << wxT("A DirectX error occurred: HRESULT = ") << e.hrString.c_str() << wxT("\nDescription: ") << e.hrDescription.c_str() << wxT("\nExpression: ") << wxString(e.expression.c_str(), wxConvLibc); wxMessageBox(message, wxT("DirectX Error"), wxCENTER | wxOK | wxICON_ERROR); return true; } catch(const std::exception& e) { wxMessageBox(wxString(e.what(), wxConvLibc), wxT("Error"), wxOK | wxICON_ERROR); return true; } return false; }...
View Full Document

This note was uploaded on 01/31/2011 for the course CS 302 taught by Professor J.parker during the Spring '08 term at University of Texas.

Page1 / 2

main - wxICON_ERROR return false bool OverlayDemo: try...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online