bug with wxVariant

Sebastien Senechal seb at cyberdine.ca
Sun Sep 24 16:20:44 PDT 2006


>  I don't want to start the discussion about whether it should be or not but
> clearly it isn't.
ok

> SS> to fastest way for me to conver an int was to do
> SS> wxVariant(str).GetLong(). am i wrong?
>
>  This surely doesn't look like the fastest or most intuitive way to do it
> for me. I'd suggest wxString::ToLong().
thought i had compiling issue while trying different approach...
thanks for the hint ! was doing the wrong way.

>  C++ isn't C#.
definitely, and prefer c++.
but some nice concept in api...

> SS> 3. wxVariant shouldn't exist or should be rewritten if that is not the
> SS> purpose.
>
>  You can't seriously propose changing existing classes used by thousands
> if not millions lines of code to do something completely different from
> what they do now, can you? I'd gladly replace wxVariant with something else
> myself but let's be a bit serious. Also, I'm far from sure that copying C#
> is such a great idea and it's definitely not the only one.

I agree. but i would have simply extended/completed it.... new functions to 
encapsulate more types... 
My reflection was actually more from my experience with QVariant from QT, than 
object in C#

but in both APIs, calling a function related to another type will attempt to 
convert that type. in QT, use canCast() do know if convertible. Qt doesn't 
have GetChar.
i simply brought up wxVariant could be upgraded it a bit, but fine, will just 
do it in my code.

And I still haven't understood why GetChar returns 0... 




More information about the wx-users mailing list