CString variable for multiline edit box not big enough?

I have a dialog with a multiline edit box that pops up when a button is clicked on another dialog. Information on the original dialog is to be displayed in the multiline edit box of this new popped up dialog. I gave the edit box a variable of type Cstring, and appended all the information to this Cstring, then in the end, write this Cstring out to the multiline edit box, but it seems it can hold up to 3 lines only...when I have more stuff appended teh old lines get overwritten...does this mean Cstring is limited to a certain number of characters? and how can I make it so that it'll let me append more lines to it to be displayed in teh edit box?
jade03Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AxterCommented:
Hi jade03,
> >does this mean Cstring is limited to a certain number of characters?
It would take a lot more then 3 lines to reach the CString limit.

Can you post your code?
Can you show how you're appending the information?

What type of data do you have in the CString?  

Does it include binary none-printable characters?

David Maisonave :-)
Cheers!
0
AxterCommented:
jade03,
FYI:
A CString object can store up to INT_MAX (2,147,483,647) characters.
See following link:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_strings_in_mfc.asp

David Maisonave  :-}
0
jade03Author Commented:
here's what I have (note, CShowInfo is a class created so that I could manipulate the look and feel of the edit box (ie changing it's bg color, text color etc), and the variable in that class, m_allInfo is a CString):

CShowInfo info;
CString finalStr;

      // string together all fields
      finalStr = "Debug:\t\tDebug Level [0-9], amount of output olsrd sends to stdout.\r\n";
      finalStr = finalStr + "IPVersion:\tIP Version olsrd is used. Default = 4\r\n";
      finalStr = finalStr + "Hna4:\t\tAnnounce connectivity to external networks using HNA messages (internet connectivity, set 0.0.0.0.0.0.0.0)\r\n";
      finalStr = "Interface:\tNetwork interface on which olsrd should run.\r\n";
      finalStr = finalStr + "AllowNoInt:\tKeeps running if no network interfaces are available? Defaults to yes\r\n";
      finalStr = finalStr + "Loadplugin:\tPlugin that olsrd is to load at startup. Must be absolute path, or loader will, ";
      finalStr = finalStr + "1) try paths in LD_LIBRARY_PATH, 2) List libraries cached in /etc/ld.so.cache, 3) /lib, followed by /usr/lib\r\n";
      finalStr = "IP4Broad:\tForces the given IPv4 broadcast address to be used as destination address for all outgoing OLSR traffic. 'auto' uses address every card is configured with.\r\n";
      finalStr = finalStr + "IP6AddrType:\tIPv6 address scope; Must be 'site-local' or 'global'.\r\n";
      finalStr = finalStr + "IP6Multi-Site:\tIPv6 multicast address to use when using site-local addresses. 'auto' uses default ff05::15.\r\n";
      


      info.m_allInfo = finalStr;

        // call child dialog to popup
      info.DoModal();
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

jade03Author Commented:
currently only the last 3 lines show up in my edit box when teh new dialog pops up
0
AxterCommented:
finalStr = "Interface:\tNetwork interface on which olsrd should run.\r\n";

The above line is overwriting everything added to the string in the previous three lines
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AxterCommented:
finalStr = "IP4Broad:\tForces the given IPv4 broadcast address to be used as destination address for all outgoing OLSR traffic. 'auto' uses address every card is configured with.\r\n";

The above line is also overwriting everything added in the previous lines.
0
jade03Author Commented:
oh my gosh! can't believe I overlooked the missing "finalStr + " thing on that line! Axter, thank you sooo much for catching that....it works now... :)
0
AxterCommented:
>>oh my gosh! can't believe I overlooked the missing "finalStr + " thing on that line! Axter, thank you sooo much for catching that....it works now... :)

Sometimes you just need a second pair of eyes to look at it.
0
jade03Author Commented:
yes, so much for my trying to save myself some typing by doing cutting and pasting....

your tip has saved me from going crazy and pulling my hair out over it...cuz I kept staring at it and couldn't find anything wrong w/ it...

u guys are great!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.