Solved

Limitation for CRichEditCtrl

Posted on 1999-01-15
2
459 Views
Last Modified: 2013-11-20
Hi,

Is there a limitation for the text in CRichEditCtrl?
0
Comment
Question by:stzclaus
2 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 50 total points
ID: 1327734
You mean the size?

If so, you can change that with EM_LIMITTEXT to increase the number of characters in the richedit control.
0
 

Expert Comment

by:mmachie
ID: 1327735
from the msdn help:

If you need to use a control that is expected to contain near or over 64 KB of data, use CRichEditCtrl or CRichEditView. These classes wrap the rich edit Windows control. In both Windows 95 and Windows NT4, there is no definite limit on the amount of text that the control can hold. Theoretically, the rich edit control allows for a maximum of 4 GB of text. In practice, you can run into performance problems with even less than 1 MB of text. Files with many lines of text (not necessarily large files, because the lines can be very short) require a lot of time and CPU power to process the first time scrolling or resizing of the view window. Once the CPU has processed these actions, the control behaves normally.

The maximum text that a CRichEditCtrl can hold can be changed by calling CRichEditCtrl::LimitText(). However, this will not effect any of the problems just mentioned. One possible option for storing huge amounts of text into a RichEdit control would be to only stream in the amount of text that is needed at a time. This would not be easy, because you need to handle the scrolling logic to load in the appropriate text for the position of the scrollbar thumb for this method to work.

Another option is to design your own Cview-based class.


hth
mikem

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
method notes when mouse over in eclipse 5 68
countEvens challenge 2 59
Line meaning 9 77
Sed question 2 49
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now