bug with wxVariant

Sebastien Senechal seb at cyberdine.ca
Sat Sep 23 09:24:36 PDT 2006


thxs for your reply

1. If char is interpreted as part of a string why does it return 0? 
is this the first character of a long casted into string? in which case 
GeString should have same behavior... counter-intuitive behavior.


2. wxVariant 'SHOULD be a container for converting objects!!!

to fastest way for me to conver an int was to do wxVariant(str).GetLong(). am 
i wrong?

Also in language as C#, 'object' is a type encpasulating most types, and is 
very poerwful and convenient... Ass i am working with genereric types,  this 
is a must.

3. wxVariant shouldn't exist or should be rewritten if that is not the 
purpose.
wxVariant should be a void* ... casted however possible and encapsulate all 
basic wxtypes i.e. ToChar, ToInt32, ToInt64, etc...

i need to implement it anyway, since this is a minivariant version as i think 
most people would want a more flexible object-like clas... wxVariant should 
be the name of such a class...



Le Saturday septembre 23 2006 08:57, Robert Roebling a écrit :
> > This fails: all result will be 0
> > 		char tot = wxVariant("255").GetChar();		=> =0x00
> > 		char tot2 = wxVariant("4").GetChar();		=> =0x00
>
> "char" is mostly interpreted as one part of a string, not
> a number. Also, wxVariant is not made to be a container
> for converting between basic types.
>
>   Robert
>
>
> --------------------------------------------------------------------




More information about the wx-users mailing list