Why do I get unprintable characters with wxGetApp().GetAppName()?

Bob wxwidgets at gmail.com
Tue Dec 11 11:47:33 PST 2007


When I try to get the name of the application using
wxTheApp->GetAppName() or wxGetApp().GetAppName()
I get non-ASCII characters (junk). What am I doing wrong here?:

// In the Minimal Sample:
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
  wxString AppNameTheApp( wxTheApp->GetAppName() );

  wxString AppNameGetApp( wxGetApp().GetAppName() );

  wxMessageBox( AppNameGetApp, AppNameTheApp, wxOK | wxICON_INFORMATION,
this);
}

This is on Windows XP, wx287, Digital Mars compiler.

>From the docs:
"wxApp::GetAppName
wxString GetAppName() const
Returns the application name.

Remarks:
wxWidgets sets this to a reasonable default before calling wxApp::OnInit..."

Unprintable characters don't seem like a reasonable name.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-users/attachments/20071211/79a=
00bb1/attachment.htm


More information about the wx-users mailing list