Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Scrolling text in MFC

This topic is 6125 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am currently trying to code a text adventure using MFC (just to learn some basics of MFC pretty much), and I have one Edit Control (CEdit) that the user types commands into, and another box (CRichEditCtrl) that the results of this command are printed in. Now, when new messages are printed to this box, I want them to be appended to the end of what is already there, so if it said "You are in room 12." and then the user typed "look", it would then say "You are in room 12" twice. The way I currently implement this is to copy the entire contents of the RichEdit box (via GetWindowText), append the user input and any other necessary text to it, and then write it all in again with SetWindowText. I imagine that when there is a lot of text to be written, however, this will be VERY slow, or even impossible on low-memory systems. Is there an easy way to append text to an Edit box? I''ve been scouring MSDN for a long time and not come up with squat. Any help would be appreciated! Anthracks

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
here''s a real simple way to do it

CString text;
m_edit1.SetSel(m_edit1.GetWindowTextLength(), m_edit1.GetWindowTextLength());

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!