/*** **** main.cpp ***/ #include "MainFrame.h" #include class MultiBoxServerApp : public wxApp { public: virtual bool OnInit(); }; IMPLEMENT_APP(MultiBoxServerApp) bool MultiBoxServerApp::OnInit() { wxXmlResource::Get()->InitAllHandlers(); wxXmlResource::Get()->Load(L"wxfb_code.xrc"); MainFrame* frame = new MainFrame(); frame->Show(true); SetTopWindow(frame); return true; } /**** ***** MainFrame.cpp ****/ #include "MainFrame.h" #include BEGIN_EVENT_TABLE(MainFrame, wxFrame) EVT_MENU(XRCID("menuFileQuit"), MainFrame::OnQuit) EVT_MENU(XRCID("menuHelpAbout"), MainFrame::OnAbout) END_EVENT_TABLE() MainFrame::MainFrame() : wxFrame(NULL, wxID_ANY, L"MultiBox Server") { wxXmlResource::Get()->LoadFrame(this, NULL, L"MainFrame"); } void MainFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { Close(true); } /**** ***** MainFrame.h ****/ #pragma once #include #include class MainFrame : public wxFrame { public: MainFrame(); void OnQuit(wxCommandEvent& event); private: DECLARE_EVENT_TABLE() };