Using MapPoint in Foxpro
Charlie Parker shares a demo for using MapPoint within Foxpro that he originally prepared for a local Foxpro user group.
If you are a Visual FoxPro developer and want to learn how to use MapPoint
in your applications, then here is a handy demo program on how to do that.
The demo program consists of a project, a main program and a form. The main
program just kicks off the form. The form has all of the logic for handling
MapPoint. The code in the form is commented so you can see fairly easily
what it is doing.
Just a few notes on the operation: The "from" and "to" addresses are hard
coded in the demo, but you can type in your own addresses or
latitude/longitudes. If you enter a latitude/longitude, separate the values
with a comma and be sure to check the box that says "Latitude, Longitude".
To have the program look up the location, click the "Compute Route" or the
"Compute Distance" button. The times it took to find the locations, compute
the route, compute the latitude/longitude, etc. are shown on the bottom of
the form.
Remember, this is just a demo, so a minimum of error checking is done. For
example, if you enter an invalid latitude or longitude, then you will get a
MapPoint error since the program does not validate these before giving them
to the MapPoint object. Also, there are a lot of things you can do with the
MapPoint object that are not shown in this demo. However, this should get you started so you can try out some of the other
features on your own.
Download it here: http://www.mp2kmag.com/downloads/foxprodemo.zip
NOTE: You must have both Visual FoxPro (any version) and MapPoint installed
in order to run the demo program.