Solved

Example for EM_POSFROMCHAR

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 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

19 Experts available now in Live!

Get 1:1 Help Now