Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

syntax for vfp6 ->mappoint beforedblclick() event

Status
Not open for further replies.

wbstrider

Programmer
Mar 2, 2001
78
US
Currently running VFP6 (happily) I am able to run mappoint, ie: make shapes, fill colors, pushpins etc

However, in order to allow the user to move the pushpin and then right click for example to allow VFP to get the new location of the pushpin, I need to be able to use the events in mappoint.

The code shown below is from the VB example in help file. Any help in converting it to VFP syntax would be fantastic.
**************
Private Sub objMap_BeforeDblClick(ByVal Button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long, Cancel As Boolean)
************** end of help code

Do I set up a 'do while' routine to await the user's response or ??


One Code to rule them all, One code to bind them.
 
There are two approaches:

A) Put the mappoint control on a form in the form designer, and add code to the VFP method on it called "BeforeDblClick" which will be automatically bound to the Event of the same name.

Or (in VFP8):
B) If you're dynamically creating the mappoint object, use BINDEVENT() to bind a vfp object's method to the MapPoint event.

Is there a reason why you haven't tried appoach "A"?

Which version of MapPoint are you using?
Version 8 ("MapPoint 2001") only seems to offer an ActiveX/OLE automation Server "Mappoint.application"... which necessitates using Approach "B".

Version 9 ("MapPoint 2004") is documented in MSDN Library as offering a "MappointControl" object that can be embedded in a form using Approach "A".

So, it seems you really NEED either VFP8 or MapPoint v9.

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Thank You,
I'll try approach A. I am running mappoint 2004 and win98.(the reason for not upgrading VFP)

Where to get the MapPoint control? Once it is on the form I'm hoping the map will be full screen? I will research.

Thank You again for the much needed assistance.

One Code to rule them all, One code to bind them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top