CString: size, new line char
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!
Re: CString: size, new line char
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
Re: CString: size, new line char
New line is '\n' not '/n'.
Dave
Re: CString: size, new line char
CString's size limit in 32-bit land is 2 Meg. In 16-bit land it was 64k.
LA Leonard - Definitive Solutions, Inc.
Re: CString: size, new line char
From the VC docs :
"A CString object can store up to INT_MAX (2,147,483,647) characters"