Re: [Dev-C++] Converting char* to wxString
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Luis B. <lf...@ya...> - 2007-08-09 17:38:55
|
=0A=0ANo. Some error. If I use:=0A=0A const char * test =3D "some_string=
";=0A wxString c(test, wxConvUTF8);=0A=0Ait works, but how to make conve=
rt with a data member?=0A=0A=0A=0A----- Original Message ----=0AFrom: mathe=
us ribeiro <mfr...@gm...>=0ATo: Luis Bras <lf...@ya...>=0ACc: =
dev...@li...=0ASent: Thursday, August 9, 2007 6:22:1=
5 PM=0ASubject: Re: [Dev-C++] Converting char* to wxString=0A=0AChange func=
tion declaration to:=0A=0Avoid wxOpengl3D::ReadFile(const wxString & file)=
=0A=0Amaybe it helps compiler find the exact match.=0A=0A2007/8/9, Luis Bra=
s <lf...@ya...>:=0A>=0A> Can someone help me?=0A>=0A> I'm trying to c=
onvert a char* to a wxString:=0A>=0A> void wxOpengl3D::ReadFile(wxString & =
file)=0A> {=0A>=0A> char * temp=3Dnew char[file.Len()+1];=0A> CText=
File cfile;=0A> wxString centerx;=0A>=0A> // Open file=0A> cfil=
e.InitializeWith((char *)file.mb_str( wxConvUTF8 ));=0A> cfile.OpenFile=
ToRead();=0A>=0A> // Get a string from file ending in ';'=0A> temp=
=3Dstrupr(cfile.get_str(temp,';'));=0A> centerx=3Dtemp;=0A> (...)=
=0A> }=0A>=0A> I get this error:=0A>=0A> error: ambiguous overload for 'ope=
rator=3D' in=0A> '((wxOpengl3D*)this)->wxOpengl3D::centerx =3D temp'=0A> C:=
/wxWidgets-2.8.4/include/wx/string.h:676: note: candidates are: wxString&=
=0A> wxString::operator=3D(int) <near match>=0A> C:/wxWidgets-2.8.4/include=
/wx/string.h:957: note: wxString&=0A> wxString::operator=3D=
(wxChar) <near match>=0A> C:/wxWidgets-2.8.4/include/wx/string.h:971: note:=
wxString&=0A> wxString::operator=3D(const wxWCharBuffer&) =
<near match>=0A> C:/wxWidgets-2.8.4/include/wx/string.h:1026: note: =
wxString&=0A> wxString::operator=3D(const wxString&) <near match>=
=0A>=0A> When using wxWidgets-2.6 no error were found.=0A>=0A> Thanks in ad=
vance.=0A>=0A>=0A>=0A> ________________________________=0A> Got a little c=
ouch potato?=0A> Check out fun summer activities for kids.=0A> -----------=
--------------------------------------------------------------=0A> This SF.=
net email is sponsored by: Splunk Inc.=0A> Still grepping through log files=
to find problems? Stop.=0A> Now Search log events and configuration files=
using AJAX and a browser.=0A> Download your FREE copy of Splunk now >> ht=
tp://get.splunk.com/=0A> _______________________________________________=0A=
> Dev-cpp-users mailing list=0A> Dev...@li...=0A> TO=
UNSUBSCRIBE:=0A> http://www23.brinkster.com/noicys/devcpp/ub.htm=0A> https=
://lists.sourceforge.net/lists/listinfo/dev-cpp-users=0A>=0A>=0A=0A=0A=0A=
=0A=0A=0A=0A=0A =0A__________________________________________________=
__________________________________=0AChoose the right car based on your nee=
ds. Check out Yahoo! Autos new Car Finder tool.=0Ahttp://autos.yahoo.com/c=
arfinder/ |