wxInitialize
Mehamli, Tristan
tmehamli at mc.com
Fri Mar 7 03:12:31 PST 2008
Hi everyone,
Some time ago I posted a question regarding the use of wxEntryStart into
a main function instead of using the macro IMPLEMENT_APP. After googling
I found that using wxInitialize was better. Ok fine but it doesn't solve
my problem which was a crash as soon as use a wxWidgets gui component
such as wxFrame :
if ( wxInitialize(argc, argv) )
{
wxAppli = wxTheApp;
}
else
{
return NULL;
}
wxFrame* topLevelWidget = new wxFrame( NULL, wxID_ANY, "" );
wxAppli->SetTopWindow( topLevelWidget );
After going into the code, I found out that only a dummy wxAppConsole
was created with little initializations and wxWidgets was actually
expecting the user to create a wxApp instance. So my question is how to
properly initialize wxWidgets into a main function?
I'd be grateful for any help.
TM
More information about the wx-users
mailing list