Author Topic: Show the wxString value script can easily be changed to this  (Read 2503 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5247
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Show the wxString value script can easily be changed to this
« on: October 09, 2009, 06:24:51 am »
Code: [Select]
mywxstring.ToAscii().m_str

I just find this from

http://www.nabble.com/KDevelop%3A-how-to-inspect-a-wxString-in-the-debugger-td20707759.html#a20708452

People says that's the way used in CodeLite. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Show the wxString value script can easily be changed to this
« Reply #1 on: October 09, 2009, 07:05:45 am »
Do you know that ToAscii() returns a 7-bit-Ascii wxCharBuffer in unicode builds ?

That means all extended characters are replaced with underscores, that is not really helpful in many cases.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5247
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Show the wxString value script can easily be changed to this
« Reply #2 on: October 09, 2009, 07:20:05 am »
Do you know that ToAscii() returns a 7-bit-Ascii wxCharBuffer in unicode builds ?

That means all extended characters are replaced with underscores, that is not really helpful in many cases.

Oh, Thanks for your hint. 16-bit wxChar is preferred.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.