Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TRichEdit MaxLength

125 views
Skip to first unread message

Paul Onstad

unread,
Mar 2, 1999, 3:00:00 AM3/2/99
to
I've switched an application's use of TMemo over to
TRichEdit and have been pleased by the results. I had a
maximum limit set for Paste but decided to free it upwards
by setting RichEdit's MaxLength property to 0. Still, there
seems to be a limit set somewhere--just under 90,000 bytes
(89993 to be precise). Once the length of the Text property
reaches that limit, no more pasting is possible and keyed-in
data is ignored too.

Is this a limit? I ask because I'd thought for awhile I was
succeeding with larger pastes (unconfirmed). I had a recent
216 error also which was at about at the time I started
using MaxLength=0. That could have changed something.

-Paul


Paul Onstad

unread,
Mar 3, 1999, 3:00:00 AM3/3/99
to

Paul Onstad wrote:

> Is this a limit? I ask because I'd thought for awhile I was
> succeeding with larger pastes (unconfirmed). I had a recent
> 216 error also which was at about at the time I started
> using MaxLength=0. That could have changed something.

Here's a little follow up. MaxLength=0 seems to have a 64K
barrier problem. RichEdit.Text=s seems fairly unlimited but
pasting beyond that point can only handle small amounts of
clipboard data--and then only at original text fills of less
than 64K.

buffer bytes paste total
fit till paste allowed

10K* 9767 64938 55171
20 19728 65536 45808
30 29971 65501 35530
40 39938 65102 25164
50 49758 65187 15429
60 59568 64704 5136
70 69301 69904 603
80 79431 locked -
90 89993 locked -
100 99571 locked -
200 199640 199898 258

(The "K" here is thousands, i.e., 10,000). Calculating MaxLength
seems necessary for most pasting jobs using RichEdit..

-Paul


Peter Below (TeamB)

unread,
Mar 3, 1999, 3:00:00 AM3/3/99
to
> I've switched an application's use of TMemo over to
> TRichEdit and have been pleased by the results. I had a
> maximum limit set for Paste but decided to free it upwards
> by setting RichEdit's MaxLength property to 0. Still, there
> seems to be a limit set somewhere--just under 90,000 bytes
> (89993 to be precise). Once the length of the Text property
> reaches that limit, no more pasting is possible and keyed-in
> data is ignored too.
>

Paul,

using MaxLength = 0 does not get you an unlimited size with a rich edit
(other than for a TEdit or TMemo on NT), it gets you a default size. If
you believe the help for EM_EXLIMITTEXT in win32.hlp (this is the
message used to implement writes to MaxLength) the default is only 32K
but that does not match experience.

Set MaxLength to a really large value, e.g. $800000. If you have D 2.0
you need to send a EM_EXLIMITTEXT message to the control directly since
the VCL uses the wrong message in this version.

Peter Below (TeamB) 10011...@compuserve.com)
No e-mail responses, please, unless explicitely requested!


0 new messages