Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rich Edit Control text size limit

Status
Not open for further replies.

Wilkibob

Programmer
Jul 28, 2003
1
GB
Using a Rich Edit Component, I found that if the text gets too long, it gets "stuck" and it is impossible to insert or append more.

I first found this with an RTF file consisting mainly of half-line paragraphs which I added bits to daily until I found it "stuck" at about 100k. It recovered when I reduced it to 80k.

To investigate, I made a stripped-down minimum project with only a Rich Edit, Open File Dialog, Save Dialog and clipboard facilities. I found that the maximum size depends on the contents.

I made a big file (104k) in Wordpad & saved it in RTF. It opened complete in Rich Edit, but was "stuck" there. I opened a smaller file (64k), copied it to the clipboard and pasted it to the end, and found only part had been pasted (size 69k) and it was stuck there. Opened a different file (20k) and pasted copies of itself to the end. The third paste was incomplete - it had stuck at 72k.

What is going on here?
 
The Delphi TMemo and TRichEdit components are in effect wrappers around the appropriate Microsoft controls.

The limits that you hit are limits imposed by Microsoft's implementation of these controls.

You will find there are larger limits in the XP and NT versions of these controls than in the Win95 and Win98 versions.

Andrew


 
Hi,

The Delphi TRichEdit have a bug, and it's not true put limit to 0 for infinite characters. Just change limit to a high number like 2000000000 and you could open, write, append big files.

Regards,
Paulo
 
A way to set this up right would be:
Code:
SendMessage(RichEdit1.Handle,EM_LIMITTEXT,$FFFFFFFF,0);
This will 'limit' the max. contentsize of the richedit1, or memo1 for that matter, to 4294967295 characters.

HTH
Tonhu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top