MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




delphi iterate pushpin dataset

This is a discussion on delphi iterate pushpin dataset within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi to All, I've a mappoint map where we added all our customers. The pushpin name is equal to my ...


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 10-12-2004
Junior Member
White Belt
 
Join Date: Oct 2004
Posts: 1
delphi iterate pushpin dataset

Hi to All,
I've a mappoint map where we added all our customers. The pushpin name is equal to my CustomerID

From delphi I'm able to iterate into pushpin dataset and create a route but it's very very slow...
I use this way:
Code:
var
  i : Olevariant;
  p : Pushpin;
begin
  FMPApp.Visible := true;
  FMPApp.OpenMap(AMapFileName, false );
  i := 1;
  FDs := FMPApp.ActiveMap.DataSets.Item[i];
  FRs := FDs.QueryAllRecords;

  FRs.MoveFirst;
  while not FRs.EOF do
  begin
    p := FRs.Pushpin;
    iff p.Name = trim(ACustID) then
      FMPApp.ActiveMap.ActiveRoute.Waypoints.Add(location(p.Location),   ACodice);
    FRs.MoveNext;
  end;
Is there a faster way to do what I want?
Becaus I need to create many routes I thought to add pushpin to a tlist the first time, and iterate TList all other times... but I'm not able to do that:

I tried that:
Code:
  FRs.MoveFirst;
  while not FRs.EOF do
  begin
    p := FRs.Pushpin;
    FList.Add(pointer(p));
    FRs.MoveNext;
  end;
but when I try to retrive the pushpin from the list I get an error.
I tried:
Code:
  (IDispatch(FList.Items[i]) as Pushpin)

  and 
 
  pushpin(FList.Items[i])
all without results.
Is the first time that I work with IDispach and all, can someone help me?

Thanks a lot

Ciao
Massimiliano
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 10-12-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Closing problem

Just to let you know,
that is not the right approach.

Now I do that:
take the map, iterate all pushpins and store coodinates to db.
After search location by lat/lon and add location to ActiveRoute.

It is very fast.

But I've another problem.
I'm not able to close mappoint, and all the times I get an errors when I close my program.
I don't use olecontainer, I just create the application at runtime and destroy it when I finish, but I can't destroy it, is allway alive ...

Can you help me?

Thanks
Massimiliano
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
dataset, delphi, iterate, pushpin


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
PushPin dataset is saved in .ptm? PeppeM MapPoint 2006/2009 Discussion 1 05-06-2006 01:53 PM
Refresh After A Pushpin Has Been Deleted From the Dataset Yazzy MapPoint 2006/2009 Discussion 3 09-15-2005 03:04 PM
Add a newly created Pushpin to Dataset Yazzy MapPoint 2006/2009 Discussion 1 08-24-2005 02:46 PM
Find Nearby Pushpin in dataset Dazzer Products: Pushpin Tool, Single State Mapper 1 10-16-2003 04:05 PM
Problems with Pushpin dataset Sylvain MapPoint 2006/2009 Discussion 13 11-28-2002 08:08 AM


All times are GMT -5. The time now is 12:29 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 55