Click to See Complete Forum and Search --> : CString: size, new line char


Shahzad
April 9th, 1999, 12:11 AM
I have tried to insert /n new line character in CString object but it takes it as a string data not a special character. Can you help me with this.

Actually I need to send email via MFC and the message is a CString object. So how can I format this CString into proper message with new line characters. Furthermore Is their any limit to the size of CString, like if the message is one page so is all has to be assigned to one CString object with no harm?

Please help!

Paul McKenzie
April 9th, 1999, 01:12 AM
For Win 32, I believe the size limit is 2^32
characters.

CString strMsg = "This is a test\n";
strMsg += '\n';
strMsg += "\n";

strMsg now has 3 new line characters. I don't
see what the problem is that you could be having.

Also, make sure that what you want is "\n". If
you want to place new lines within an edit field,
the characters are "\r\n".

Regards,

Paul McKenzie

Dave Lorde
April 9th, 1999, 05:26 AM
New line is '\n' not '/n'.

Dave

LALeonard
April 9th, 1999, 09:45 AM
CString's size limit in 32-bit land is 2 Meg. In 16-bit land it was 64k.

LA Leonard - Definitive Solutions, Inc.

Gomez Addams
April 9th, 1999, 11:23 AM
From the VC docs :
"A CString object can store up to INT_MAX (2,147,483,647) characters"