WxString
Convert
std::string to wxString
std::string stlstring = "Hello world";
// assuming your string is encoded as UTF-8, change the wxConv* parameter as needed
wxString mystring(stlstring.c_str(), wxConvUTF8);
Starting from wxWidgets 3.0, you may also use the appropriate constructor
std::string stlstring = "Hello world";
// assuming your string is encoded as the current locale encoding (wxConvLibc)
wxString mystring(stlstring);
wxString to std::string
wxWidgets 2.8 :
Under wxWidgets 3.0, you may use
References
-
Converting_everything_to_and_from_wxString.pdf ↩