Author Topic: wxString Private  (Read 5594 times)

devilsclaw

  • Guest
wxString Private
« 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

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: wxString Private
« Reply #1 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.
« Last Edit: March 30, 2007, 11:13:39 pm by TDragon »
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

devilsclaw

  • Guest
Re: wxString Private
« Reply #2 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

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: wxString Private
« Reply #3 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.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)