Solved

Example for EM_POSFROMCHAR

Posted on 1998-12-19
5
1,135 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

773 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