I'm having trouble getting the character index in a Rich Edit control at the mouse pos.
Here's my code (x & y are client mouse co-ords relative to the client):
LP, RchPos: DWORD;
LP := MakeLParam(x, y);
RchPos := LOWORD(rchTest.Perform(EM_CHARFROMPOS, 0, LP));
It gives the following error: "Access Violation at address XXXXX in module 'RichEd32.dll'."
Any solutions would be much appreciated!