hello to all! this is my first post and i'm on my first experience with wxWidgets libraries!
here's my problem: i need to change the Text of a label, using a normal string variable coming from another class. there's a way to convert a normal string to a wxString?
sorry from my poor english, i'm italian have a nice day!
[/code]
wxString -> how to convert a normal string into a wxStrin
Yeah, easily. Something like this will work:
Easy as that. You can use a normal string anywhere a wxString is required. The only thing you really can't do is the reverse - something like "normalstr = wxstr" (though "normalstr = wxstr.c_str()" should work).
Code: Select all
char* normalstr = "something";
wxString wxstr = normalstr;
-
- Super wx Problem Solver
- Posts: 424
- Joined: Tue Jul 12, 2005 8:44 pm
- Location: Alabama, USA
If you're talking about std::string, then try
-Scott
Code: Select all
std::string myString = "something";
wxString wxstr = myString.c_str();
wxMSW 2.6.2, VS 2002, 2003 and 2005, Code::Blocks and mingw, Windows XP Pro