Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Nov : AV when sending EM_CHARFROMPOS to TRichEdit

www.cryer.info
Managed Newsgroup Archive

AV when sending EM_CHARFROMPOS to TRichEdit

Subject:AV when sending EM_CHARFROMPOS to TRichEdit
Posted by:"Gerrit Beuze" (gerrit[at]modelmaker[dot]demon[dot]nl)
Date:Thu, 17 Nov 2005 15:52:43 +0100

Hi all,

Using D7 I have a TRichEdit and I want to retrieve the char on which I clicked.
According to Win32 help this can be done with:

  SendMessage(RichEdit1.Handle, EM_CHARFROMPOS, 0, LPARAM);

where LPARAM is a LongRec containing x and y cooridinates.

For a plain edit this works OK, for a richedit this causes an AV
in procedure TWinControl.DefaultHandler(var Message);
when calling this line: (Delphi 7 source Controls.pas)
          Result := CallWindowProc(FDefWndProc, FHandle, Msg, WParam, LParam);

Is this a known bug?
Any workaround?

Thanks in advance,

Gerrit Beuze
ModelMaker Tools

Info

Glossary

File Types

Replies:

www.cryer.info
Managed Newsgroup Archive