此代碼工作正常:wxWidgets的是OnInit
#include <wx/wx.h>
class MyApp : public wxApp
{
virtual bool OnInit();
};
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
wxFrame *frame = new wxFrame(NULL, -1, _("Hello World"), wxPoint(50, 50),
wxSize(450, 350));
frame->Show(true);
return true;
}
但這並不:
#include <wx/wx.h>
class MyApp : public wxApp
{
virtual bool OnInit();
};
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
wxFrame frame(NULL, -1, _("Hello World"), wxPoint(50, 50),
wxSize(450, 350));
frame.Show(true);
return true;
}
它不給任何編譯/鏈接/執行錯誤,就是不現身窗口。爲什麼這個?