home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.paradox      To crash or not to crash, asks Borland      9,834 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,115 of 9,834   
   Jim Moseley to All   
   MapPoint ActiveX control integration wit   
   14 Mar 08 13:15:32   
   
   From: jmose@mapson.attglobal.net   
      
   Greetings all.  I had to integrate MapPoint into my Pdox 9 application.  From   
   all the history here, it seems like others were having trouble with this,   
   so I thought I'd post a basic solution - it even works in Runtime.   
      
   I'm using MapPoint 2004.  If someone has 2006, can you test this to see if   
   it still works?   
      
   First, add the MapPoint ActiveX Control to the ActiveX toolbar.  From there,   
   add it to your form.  Then, it's just a matter of controlling the control.   
    For some reason, you can't directly access the Map object.  But, the OCX   
   has an ActiveMap property that returns the Map itself.  The same applies   
   with the Route object - you use the ActiveRoute property to get the Route.   
      
      
   HTH,   
   Jim Moseley   
      
      
      
   method pushButton(var eventInfo Event)   
      
   var   
   	oaMP1,   
      oaMap,   
      oaRoute,   
      oaStops,   
      oaLocation   
      oleAuto   
      dyn	dynarray[] anytype   
   endVar   
   doDefault   
      
   MapPointOCX.NewMap(1)   
      
   while not MapPointOCX.ReadyState = 4   
   	sleep(200)   
   endWhile   
      
   if not oaMP1.attach(MapPointOCX) then   
   	errorShow()   
   	return   
   endif   
      
   oaMap = oaMP1.ActiveMap   
   oaRoute = oaMap.ActiveRoute   
   oaRoute^clear()   
   oaStops = oaRoute.WayPoints   
   oaLocation = oaMap^getLocation(30.299, -81.708)   
   oaStops^add(oaLocation, "Start")   
   oaLocation = oaMap^getLocation(33.321, -83.321)   
   oaStops^add(oaLocation, "Stop 1")   
   oaLocation = oaMap^getLocation(35.321, -82.321)   
   oaStops^add(oaLocation, "End")   
   oaRoute^calculate()   
      
   driveTime = round(oaRoute.DrivingTime * 24,2)   
      
   endMethod   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca