CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 1999
    Posts
    388

    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!


  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    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


  3. #3
    Join Date
    Apr 1999
    Posts
    383

    Re: CString: size, new line char

    New line is '\n' not '/n'.

    Dave


  4. #4

    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.

  5. #5
    Join Date
    May 1999
    Location
    Oregon, USA
    Posts
    302

    Re: CString: size, new line char

    From the VC docs :
    "A CString object can store up to INT_MAX (2,147,483,647) characters"



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured