Basic CString question - URGENT

benhere
benhere used Ask the Experts™
on
Hi,
I'm programming with Visual C++ 6.0
I want to add a "tab" character in a CString.

Here's what I am doing right now:

CString send = "something";
m_listBox->AddString( "Send : \t" + send );

and it doesn't work, a black character is inserted instead of a tab.

So how can I do that?
Thanks a lot!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
points for clockwatcher
Strange, that looks like it should work.

I'm not sure why this would make any difference but, have you tried inserting the \t character at the beggining of your string? More importantly, are you sure that this function allows non-displayable characters?
Further more, you could try this:

m_listBox->AddString( "Send : " + (char)9 + send );

Author

Commented:
cool, (char)9
that's the chr(9) function I was looking for :-)
thanks

it seems that both options must be enabled..
http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_20406198.html

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial