Community of VE/MapPoint Users and Developers
This is a discussion on How do you read from a FindResults type in delphi? within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; oResult : FindResults; FMap : _map; begin FMap := Application1.ActiveMap as _Map; Loc := FMap.GetLocation(X, Y,1) as Location; Loc.GoTo_; oResult ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| How do you read from a FindResults type in delphi? FMap : _map; begin FMap := Application1.ActiveMap as _Map; Loc := FMap.GetLocation(X, Y,1) as Location; Loc.GoTo_; oResult := FMap.ObjectsFromPoint(FMap.LocationToX(Loc),FMap.L ocationToY(Loc)) as FindResults; if i use this code to search with i get 5 results. but i cannot read any of the results. Every thime i try i get an access violation. I have tried several different code samples from this site and i allways get an access violation any ideas? |
| |||
|
Hello, Try the following: procedure TForm1.Button1Click(Sender: TObject); var vFindResult : FindResults; vStreetAddress : StreetAddress; vResult : string; i : integer; iOle : OleVariant begin for i := 1 to vFindResult.Count do begin iOle := i; // To access name result: vResult := (vFindResult[iOle] as Location).Name; // Or to access streetaddres result: vStreetAddress := (vFindResult[iOle] as Location).StreetAddress; if Assigned(vStreetAddress) then begin ... end; end; end; Greetings, Jack. |
| |||
| How do you read from a FindResults type in delphi?
That works fine if the result object is a Location, but what if it happens to be a PushPin ? Then casting it to a Location would give strange results, no ? So how can you tell want the result object type is ? Rene |
![]() |
| Tags |
| delphi, findresults, read, type |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to read .shp files | shaileshganatra | MapPoint 2006/2009 Discussion | 1 | 09-10-2008 08:46 PM |
| [HELP]: Problem with C# and FindResults | Anonymous | MapPoint 2006/2009 Discussion | 0 | 08-27-2004 03:51 AM |
| set note read-only | Anonymous | MapPoint 2006/2009 Discussion | 0 | 08-05-2003 10:50 AM |
| OS Grid References - FindResults | Anonymous | MapPoint 2006/2009 Discussion | 3 | 10-14-2002 04:20 AM |
| I have read you can zoom the map to any lat/long f.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 08-19-2001 04:50 AM |