Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 2 of 2

TMap.OnBeforeClick event returns bad data

This is a discussion on TMap.OnBeforeClick event returns bad data within the MapPoint Desktop Discussion forums, part of the Map Forums category; I am trying to use the TMap.OnBeforeClick event to determine when the user holds the control key and clicks on ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    TMap.OnBeforeClick event returns bad data

    I am trying to use the TMap.OnBeforeClick event to determine when the user holds the control key and clicks on the map. MapPoint documentation makes this look trivial; however, the Button, Shift, X, and Y values all return incorrect information. The value of Shift should be 2 when the control key is held during the click. On inspection Shift returns a different value every time I click on the map while holding the control key. The same thing happens with the value of Button.

    Does anyone have any suggestions as to what the problem might be? I am using Delphi rather than VB. Does the event return the correct values when used with VB?

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    I figured it out...

    After looking at the type library I discovered that the TMap.OnBeforeClick event is passing the correct data just not in the order I expected. The problem involves calling conventions. By default VB uses a right to left convention while Delphi uses a left to right calling convention.

    The parameters for the OnBeforeClick event are Button, Shift, X, Y, Cancel, respectively. In Delphi, I have to receive them in reverse order due to the change in calling convention, i.e. (Cancel, Y, X, Shift, Button).

    All the parameters are Integers, so I never got an error when the parameter lists were compared at compile time.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Custom location returns null when using find nearby in route
    By briansbrown in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 11-15-2005, 01:40 PM
  2. Is MapPoint or something else best to map election returns?
    By jhbroussard in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 08-24-2005, 07:44 AM
  3. FindAddressResults returns nothing
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 12-07-2004, 04:23 AM
  4. GetPictureFromObject returns strange maps
    By cd4000 in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 08-30-2004, 06:12 PM
  5. Mappoint-Refresh linked data on a form load event ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-22-2001, 01:38 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25