MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




How do you read from a FindResults type in delphi?

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 ...


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

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 07-16-2003
Junior Member
Yellow Belt
 
Join Date: Jul 2003
Posts: 14
Send a message via MSN to matt1168
How do you read from a FindResults type in delphi?

oResult : FindResults;
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 07-16-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 07-16-2003
Junior Member
Yellow Belt
 
Join Date: Jul 2003
Posts: 14
Send a message via MSN to matt1168
Thanks that works great
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 02-27-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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
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
delphi, findresults, read, type


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 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


All times are GMT -5. The time now is 09:50 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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