main - wxICON_ERROR); return false; } } bool

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&amp; e) { const wxString message = wxString() &lt;&lt; wxT(&quot;A DirectX error occurred: HRESULT = &quot;) &lt;&lt; e.hrString.c_str() &lt;&lt; wxT(&quot;\nDescription: &quot;) &lt;&lt; e.hrDescription.c_str() &lt;&lt; wxT(&quot;\nExpression: &quot;) &lt;&lt; wxString(e.expression.c_str(), wxConvLibc); wxMessageBox(message, wxT(&quot;DirectX Error&quot;), wxCENTER | wxOK | wxICON_ERROR); return true; } catch(const std::exception&amp; e) { wxMessageBox(wxString(e.what(), wxConvLibc), wxT(&quot;Error&quot;), wxOK | wxICON_ERROR); return true; } return false; }...
View Full Document

Page1 / 2

main - wxICON_ERROR); return false; } } bool

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