MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




[HELP]: Problem with C# and FindResults

This is a discussion on [HELP]: Problem with C# and FindResults within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi; I have a problem with this code (geocode reversing) and I hope that you help me: FindResults function work ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-27-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
[HELP]: Problem with C# and FindResults

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
findresults, problem


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
How do you read from a FindResults type in delphi? matt1168 MapPoint 2006/2009 Discussion 3 02-27-2004 07:57 AM
OS Grid References - FindResults Anonymous MapPoint 2006/2009 Discussion 3 10-14-2002 03:20 AM


All times are GMT -5. The time now is 02:52 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Taba Heights Holiday
Visit Egypt with your Taba Heights holiday. Book through UlookUbook and save!



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59