Click to See Complete Forum and Search --> : CStrings & Edit Boxes


John Hagen
May 11th, 1999, 09:38 PM
I am trying to put together 2 CStrings, display them in an edit box, and have a carriage return/line feed <CRLF> between each string. So far all of my attempts have failed miserably. This is what I am doing:

CString string1 = "This is string 1.\n ";
CString string2 = "This is string 2.";

m_string3 = string1 + string2;

UpdateData...

What I want displayed in the edit box is:

This is string 1.
This is string 2.

What I get is "This is string1.| This is string2." The | is a real dark black line. The strings are put together but I don't get the <crlf> like I want. Any suggestions? I know this has to be easier than it is.

Thanks in advance!

John Hagen

Chao
May 11th, 1999, 10:23 PM
Hi,

I think you forgotten the CR in the CRLF.
CRLF consists of "\r\n" and not "\n" alone.

Hope that helps.
Chao

John Hagen
May 11th, 1999, 11:34 PM
Yes, that was my problem. Beginners ignorance gets me every time. Thank you for replying and pointing out the errors of my ways.

John Hagen