Hi;
I have a problem with this code (geocode reversing) and I hope that you help
me:
FindResults function work well and return items, but I canīt retrieve
StreetAddress Location Object.
Error is " Reference Objet is not establish."
Note:
This function is in a Class (*.dll) that use a client (windows service).
************************************************** ********
public string GetLocation(double longitud, double latitud)
MapPoint.ApplicationClass mpApp = new MapPoint.ApplicationClass();
MapPoint.Map mpMap = mpApp.ActiveMap;
MapPoint.Location mpLocation;
MapPoint.FindResults mpResults;
string addressInfo = string.Empty;
mpLocation = mpMap.GetLocation( latitud, longitud, 1 );
mpLocation.GoTo();
mpResults = mpMap.ObjectsFromPoint( mpMap.LocationToX(mpLocation),
mpMap.LocationToY(mpLocation) );
if( mpResults != null && mpResults.Count > 0){
// object index = 1;
// MapPoint.Location oLoc = (MapPoint.Location) mpResults.get_Item( ref
index );
IEnumerator ienum = mpResults.GetEnumerator();
ienum.Reset();
ienum.MoveNext();
MapPoint.Location oLoc = (MapPoint.Location) ienum.Current;
if ( oLoc != null ){
addressInfo= oLoc.StreetAddress.Value; // ************ ERROR
************
return (addressInfo );
}}}
************************************************** ********
Thanks
Mario Barro.