Basic CString question - URGENT

benhere used Ask the Experts™
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!
Watch Question

Do more with

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


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 );


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

it seems that both options must be enabled..

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