Solved

Example for EM_POSFROMCHAR

Posted on 1998-12-19
5
1,148 Views
Last Modified: 2012-08-13
Can anyone please give me a <b>working</b> example of EM_POSFROMCHAR??? When you use the SendMessage-function as described in the win32.hlp, you only get some strange errors!
0
Comment
Question by:Metty
  • 2
  • 2
5 Comments
 

Author Comment

by:Metty
ID: 1352007
Adjusted points to 100
0
 
LVL 1

Expert Comment

by:Oli2
ID: 1352008
what kind of errors do you get?
0
 

Author Comment

by:Metty
ID: 1352009
I'm running under Delphi3, Win95 and I'm getting an Access Violation in "RichEd32.DLL"

0
 
LVL 1

Accepted Solution

by:
jecksom earned 100 total points
ID: 1352010
Hi Metty!

From inprise's developer support :

http://www.inprise.com/devsupport/delphi/qanda/FAQ1055D.html

Question and Answer Database

  FAQ1055D.txt   Avoiding an Application Error when using EM_POSFROMCHAR
  Category   :VCL
  Platform    :All
  Product    :Delphi 3.x  

  Question:
  How can I avoid an Application Error when using the EM_POSFROMCHAR
  and EM_POSFROMCHAR in a RichEdit control?

  Answer:
  The definitions for EM_CHARFROMPOS and EM_POSFROMCHAR are different
  in the RichEdit and Messages units:

  RichEdit unit:
    EM_POSFROMCHAR         = WM_USER + 38;
    EM_CHARFROMPOS         = WM_USER + 39;

  Messages unit:
    EM_POSFROMCHAR         = 214;
    EM_CHARFROMPOS         = 215;

  To avoid confusion, these constants have been removed from the
  RichEdit unit in Delphi 3.

  When using the EM_POSFROMCHAR message, WParam should contain the
  address of the point structure that will receive the coordinates,
  and LParam should contain the zero based offset of the character. The
  return value is not initialized. Note that the y coordinate can be
  zero or negative.

  When using  EM_CHARFROMPOS, wparam is not used, and LParam should
  contain the address of the point structure that will receive the
  coordinates. The return value should contain the required character
  index.



  7/16/98 4:31:28 PM

--------

Is that error that your asking for ?

Jecksom

0
 
LVL 1

Expert Comment

by:jecksom
ID: 1352011
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question