Problem with CString

i have a siily problem with CString ( MFC project in VC++6) . I don't understand why!!!
There is a line " CString line = _T("abc") " in my project, I think the value of line = "abc", but when debugging,in watch windown line = {a}.
Please tell me why? Thanks
It might that you're building a Unicode build but have not told the debugger to display unicode strings?

If so...

- use "Tools"\"Options" to open the Options dialog
- select the "Debugger" tab
- check the "Display unicode strings" checkbox

Andy

PS As a Unicode string looks like H\0e\0l\0l\0o\0 in memory, you can see how it would display if the debugger though the memory contained a char string!
Last edited on
I have created a simple project to check, in watch windown line = {abc} . Then I check
the "Display unicode strings" checkbox but check box is not checked. So this is not involve in. But in my real project doesn't display line = {abc}.
To debug Unicode string you need to have the box checked (you said it was unchecked?)

Or you could (if possible) just recompile you app as Multi-Byte, which would just avoid the problem.

You are using _T(), etc throughout your code, yes?

Andy
Topic archived. No new replies allowed.