wxWidgets and string & iostream

Fibre Optic fibre_optic at go2.pl
Tue Sep 5 01:59:29 PDT 2006


Teo Fonrouge wrote:
> On Mon, 2006-09-04 at 16:03 +0200, Fibre Optic wrote:
>> Hello,
>>
>> I have just written the following small code which has the following 
>> declaration:
>>
>> wxString xxxx = "TEST";
> 
> Maybe you are using the UNICODE wxWidgets version, anyway you need to
> use the following form to properly assign a wxString type var:
> 
> wxString xxxx = _T("TEST"); // or wxT("TEST")
> 
>> and i am going to print it out on the following way:
>>
>> std::cout << "xxxx= " << xxxx << endl;
> 
> in this case you need to change the wxString var contents to multibyte C
> string:
> 
> std::cout << "xxxx= " << xxxx.mb_str() << endl;
> 
>> There is not problem with compilation or linking but during execution i 
>> se segmentation fault + stac trace... Is it possible to mix wxWidgets 
>> classes with i.e. strings/iostream functionality?
> 
> AFAIK yes
> HTH

After changes you have suggested the effect is still the same :-( I do 
not use wxwidget with UNICODE support. Have you ever tried to mix 
wxString and iostream?

Regards,
Fibre Optic








More information about the wx-users mailing list