Hi Nico and Group,
I could very well be wrong, but I did not find using the API necessary because
using Gilles' CalcPos determined the coordinates very well.
Here's an example:
Iterating through WayPoints, I select a SegmentDirection
oRoute.Waypoints(intWpt).SegmentDirections(intDir) .Select
To be sure that MapPoint changes selection, I force the issue
Call oMapCtl_SelectionChange (oRoute.Waypoints(intWpt).SegmentDirections(intDir ).Location, oMap.Location)
I save the calculation from CalcPos in DirLat and DirLong,
which can also be made public properties were I to need them.
'Declarations Section of cMapPt
Private dblDirLat As Double
Private dblDirLong As Double
Private DirLat As Double
Private Dirlong As Double
'Event Proc of MapPoint ActiveX
Private Sub oMapCtl_SelectionChange (ByVal NewSelection As Object, ByVal OldSelection As Object)
CalcPos oMap, NewSelection.Location, dblCtrLat, dblCtrLong
Debug.Print dblCtrLat & ", " & dblCtrLong
DirLat = dblCtrLat
Dirlong = dblCtrLong
End Sub
Michael R Mattys
www.mattysconsulting.com