Solved

Example for EM_POSFROMCHAR

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now