Similar Threads:
1.Formatting double with wxString::Format
Hi,
my program is compiled with MinGW on XP with wxWidgets-2.8.8.
Using wxString::Format("<%010.2f>", 3.14) I get the result
"< 3.14>" (padded with blanks).
When I use sprintf(buf, "<%010.2f>", 3.14) instead, then I get the
correct result "<0000003.14>".
Is this a bug in wxString?
Lutz
2.wxString::Format way of putting commas in numbers: ie 10,000
3.CVS HEAD wxString::Format crash
I'm trying to port my codebase to wxWidgets 2.7 CVS HEAD from 2.6.3
this code worked in 2.6.3
wxString fun = "FLASH_GetWidth";
wxString arg = "";
wxString::Format("<invoke name=\"%s\"
returntype=\"xml\"><arguments><string>%s</string></arguments></invoke>", fun
, arg );
but it crashes in CVS HEAD
if i change it to
wxString::Format("<invoke name=\"%s\"
returntype=\"xml\"><arguments><string>%s</string></arguments></invoke>",
fun.c_str() , arg.c_str() );
or even to
wxString::Format("<invoke name=\"%s\"
returntype=\"xml\"><arguments><string>%s</string></arguments></invoke>",
fun.c_str() , arg );
it works.
So it seems the last parameter can be a wxString and automatically gets
converted. but the ones before that do not.
I'm using visual studio 2005 professional, UNICODE=0, WCHAR_T=1
Does anyone know if this is a bug? or do I just have to add .c_str() in
hundreds of places in my code?
Thanks,
Willem
I'm trying to port my codebase to wxWidgets 2.7 CVS HEAD from 2.6.3<br><br>this code worked in 2.6.3<br><br> wxString fun = "FLASH_GetWidth";<br> wxString arg = "";<br> wxString::Format("<invoke name=\"%s\" returntype=\"xml\"><arguments><string>%s</string></arguments></invoke>", fun , arg );
<br><br>but it crashes in CVS HEAD<br><br><br>if i change it to <br><br> wxString::Format("<invoke name=\"%s\" returntype=\"xml\"><arguments><string>%s</string></arguments></invoke>",
fun.c_str() , arg.c_str() );<br><br>or even to<br><br> wxString::Format("<invoke name=\"%s\" returntype=\"xml\"><arguments><string>%s</string></arguments></invoke>",
fun.c_str() , arg );<br><br><br>it works.<br><br><br>So it seems the last parameter can be a wxString and automatically gets converted. but the ones before that do not. <br><br><br>I'm using visual studio 2005 professional, UNICODE=0, WCHAR_T=1
<br><br><br>Does anyone know if this is a bug? or do I just have to add .c_str() in hundreds of places in my code?<br><br><br>Thanks,<br>Willem<br><br><br>
4.wxString::Format and Unicode
5.wxString::Format
Why does the third line of this code:
wxString s = wxT("");
s.Printf(wxT("%d"), parseIndex);
s += wxString::Format(wxT("%d"), parseIndex);
give me this error from the gcc compiler: "parse error before numeric
constant" , while the second line is fine?
Bill
---------------------------------------------------------------------
To unsubscribe, e-mail: XXXX@XXXXX.COM
For additional commands, e-mail: XXXX@XXXXX.COM
6. [2.5.3] wxString::Format and unicode
7. wxString, Format etc.
8. wxString::Format and %