Can someone tell me how to overcome the RichEdit Line limit?
(WordPad has about a 3,068 character Line Limit. I need to get way over this
line limit, about 10,000+ Characters
Is what I need to go with)
I know how to overcome the File Size limit.
Using: RichEdit1.Perform(EM_LIMITTEXT,0,$7FFFFFF);
But what I am needing is the [Line - String] Limit.
Any idea's on this one?
Thanks all;
Wayne
> Can someone tell me how to overcome the RichEdit Line limit?
The limit you describe is hard-coded into the VCL (specifically, in the
TRichEditStrings.Get() method - it uses a 4K text buffer). To get around
it, you will have to manually send the EM_GETLINE message directly to the
RichEdit's HWND window. Then you can use any size buffer you want. Refer
to the Win32 API documentation for more details.
Also, you will likely have to stop using the TRichEdit component altogether
in order to load text into such long lines to begin with. TRichEdit uses
the RichEdit v1.0 API control. RichEdit v2.0, which the VCL does not use,
does not have such limits on line lengths. There are third-party components
that wrap RichEdit v2.0+ versions, or you can instantiate and access the
newer controls in straight Win32 API code yourself.
Gambit
I have tried out several 3rd part components and nothing so far.
Could you perhaps give me some more information on this, or maybe
Some code to implement this?
I know this is asking a lot, if all else.
A direct link to some good information.
Thank you
Wayne
> I have been doing some checking and research, and cannot really
> Find enough information on : EM_GETLINE
Gambit
If you have a solution for this, I would be mighty grateful for it.
As right now, I am literly stuck.
Thanks for your assistance so far.
Wayne
> Remy, I have looked thru the link that you sent.
> And I have searched through Google, and several KB Delphi
> sites That I am a member of, and ask several people, and no
> one not even myself Has a clue on how to do the EM_GETLINE
> to extent out the Line(s) of RichEdit To allow more then the
> 3,068 (or) 4,000 (which ever one that it is)
Please read the MSDN article again. It tells you what to do:
lParam
Pointer to the buffer that receives a copy of the line. Before
sending the message, set the first word of this buffer to the size, in
TCHARs, of the buffer. For ANSI text, this is the number of bytes; for
Unicode text, this is the number of characters. The size in the first word
is overwritten by the copied line.
Simply specify a buffer that is large enough, and EM_GETLINE will fill it as
much as it can. You can use EM_LINELENGTH to find out the length of a line
beforehand so that you can allocate a large enough buffer as needed.
Gambit