Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: devilsclaw on March 30, 2007, 10:57:57 pm

Title: wxString Private
Post by: devilsclaw on March 30, 2007, 10:57:57 pm
every time i try to use anything with wxString it tells me that is private.

i have looked at other code and they use it but i dont see how it allows them to.. i have copied there includes and everything still cant get it to let me


right now trying wxString::Format(_("%s %d"),strVal,intVal);

and the compiler tells me that wxString(int) is private

how do i make it work
Title: Re: wxString Private
Post by: TDragon on March 30, 2007, 11:08:24 pm
You haven't given enough context information to diagnose the problem. Assuming strVal is of type wxChar* and intVal is of some integer type, that appears to be the correct usage.

An issue as basic as this probably doesn't belong in the C::B development forums either, unless you had managed to definitively trace the source of some sort of unexpected or incorrect behavior with wxStrings to a piece of C::B-related code.
Title: Re: wxString Private
Post by: devilsclaw on March 30, 2007, 11:18:23 pm
thanks my bad that variable that was supposed to be int type was size_t so i had to type cast it
Title: Re: wxString Private
Post by: TDragon on March 30, 2007, 11:25:19 pm
that variable that was supposed to be int type was size_t so i had to type cast it
Actually, passing an argument of type size_t as an integer argument to a varargs function (such as Format) is perfectly acceptable, size_t being an integer type. Additionally, the only error checking that GCC does on arguments to varargs functions is to raise a warning if a non-POD type is passed.

At any rate, although this wasn't the source of your problem, I'm glad it was solved.