Page 1 of 1

RichViewEdit.GetTextLen always "0"

Posted: Sun Nov 12, 2006 5:30 pm
by Crowbar
Hi,
the Standard-RichEdit is ok! The result is to example "20".
MaxLen:=RichEdit.GetTextLen;

With RichViewEdit is the result always "0".
MaxLen:=RichViewEdit.GetTextLen;

How can I get length of the total text in the RichViewEdit?

Another question:
Why do I get "0" forever also with this function?
...
TextLenEx.flags := GTL_DEFAULT;
TextLenEx.codepage := CP_UTF8;
MaxLen:=SendMessage(RichViewEdit.Handle, EM_GETTEXTLENGTHEX, Integer(@TextLenEx), 0);
...

Crowbar

Posted: Tue Nov 14, 2006 7:20 pm
by Sergey Tkachenko
GetTextLen simple uses WM_GETTEXTLENGTH message.

Processing of WM_GETTEXT, WM_GETTEXTLENGTH, WM_SETTEXT was disabled for Delphi 2005 and 2006, because it conflicted with VCL implementation. Sorry, I do not plan to restore them.

EM_GETTEXTLENGTHEX is not supported.

Use the functions RVGetTextRange and RVGetTextLength from RVLinear.pas.