Board index » delphi » Delphi 6 - Windows XP SP1 - TRichEdit causes error

Delphi 6 - Windows XP SP1 - TRichEdit causes error

Hi,
my program written Delphi 6 personal + SP2 works under Windows 9x and XP OK, but under XP + SP1 component TRichEdit causes "Line
insert error"

There are any fix for this?

thanks, Petr

 

Re:Delphi 6 - Windows XP SP1 - TRichEdit causes error


you must determine if the error differs depending in the amount out content
in the richedit.
 if so then you need to set the EM_SETLIMITEXT
Quote
Petr Burian wrote:
> Hi,
> my program written Delphi 6 personal + SP2 works under Windows 9x and XP OK, but under XP + SP1 component TRichEdit causes "Line
> insert error"

> There are any fix for this?

> thanks, Petr

Re:Delphi 6 - Windows XP SP1 - TRichEdit causes error


Quote
In article <3e3e0...@newsgroups.borland.com>, Petr Burian wrote:
> my program written Delphi 6 personal + SP2 works under Windows 9x and XP OK, but under XP + SP1 component TRichEdit causes "Line
> insert error"

> There are any fix for this?

This error is usually due to adding lines to the richedit control using lines.add.
Some versions of the richedit control trim whitespace off the ends of lines, and
that leaves the caret at a position other than the VCL expects.

The workaround is to forget lines.add and add lines like this:

 with richedit1 do begin
   selstart := gettextlen;  // set caret to end of text
   seltext := stringtoadd + #13#10;
 end;

If you add a bunch of lines you only need to set selstart to the end of text
at the beginning.

--
Peter Below (TeamB)  
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be

Other Threads