Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 10 of 10

addpushpin problem

This is a discussion on addpushpin problem within the MapPoint Desktop Discussion forums, part of the Map Forums category; I'm writing a program where a history of tractors can be plotted on the map. Everything goes fine, except for ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    addpushpin problem

    I'm writing a program where a history of tractors can be plotted on the map.
    Everything goes fine, except for one error i keep having.
    When adding pushpin, sometimes I get the error :"Run-time error '-2147467259(80004005)':

    Method 'AddPushpin' of object '_Map' failed"

    I must say, when plotting the history, sometimes more then 1000 pushpins have to be added, but this should not be a problem for mappoint i think, or am i wrong?

    What i basicly do is:
    -get the positions into a collection of "position" object
    (position --> lat, lon, date, name...)
    -loop through the collection, and add each position to the Pushpinset

    can somebody help me??

    thx in advance

  2. #2
    John Meyer's Avatar
    John Meyer is offline Senior Member Blue Belt
    Join Date
    Jul 2002
    Posts
    478
    is it possible that one of your "MapPointCtl.Location' that you are looping thru is nothing? is it random or does it stop on the same location each time?

    Without seeing the real code its kinda hard to debug, not sure what type of error checking you might already have.

  3. #3
    Joeba is offline Junior Member White Belt
    Join Date
    Sep 2002
    Posts
    7
    It's a random problem, so it has nothing to do with the location object i think(always has a correct value).
    I also get the folowing runtime error from mappoint itself:
    "R6025
    -pure virtual function call"

    So my guess was that the addpushpins were folowing eachother to quick, and that mappoint couldn't handle them all.
    So I reduced the amount of loops, from about 1000 to 200, and repeated this several times, worked good.

    Then I did the same, but started all sorts of programs during the process, and guess what, same error.

    So it has something to do with not enough memory or something like that.

    Is there a better way of plotting positions?
    what i do is:
    -get all positions
    -loop all these positions and add a pushpin for each location

    Ideal would be if i could just have a collection of locations, and plot this collection, but don't know if this is possible.

    Any suggestions are welcome :)

    tnx

  4. #4
    John Meyer's Avatar
    John Meyer is offline Senior Member Blue Belt
    Join Date
    Jul 2002
    Posts
    478
    How about the Data Import Wizard, either put your data in excel or access. Something to try, would be intresting to see if that worked better or not.

  5. #5
    Joeba is offline Junior Member White Belt
    Join Date
    Sep 2002
    Posts
    7
    Also thought of trying that, but i didn't like the idea of giving all control to mappoint, if i added the pushpins "manualy", then i could make a nice progressbar etc...

    but tried it anyways, and idd, you were right, plotting the pushpins is much faster!

    the only problem now is that my nice progress bar is no more :p
    or is there a way of detecting what mappoint is doing, busy plotting pushpins or something like that...

    tnx for the help, will try to implement it this way

    Greetz Joeba

  6. #6
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    Bad news first: I do not have a solution for your problem.

    Then good news: I get the same error when adding pushpins of my locations programatically. It is an intermitent problem. I load the same data all the time. The error does not happen at the same data point. The error correspond to an automation error (according to hitting F1 in the VB developemnt HELP)


    Vic

  7. #7
    Gryffyn is offline Junior Member White Belt
    Join Date
    May 2004
    Posts
    9
    Anyone ever find a solution to this problem?

    I have an Excel VBA script that gets a list of origin/destination airports for the truckers we manage and I'm trying to plot pushpins for the trucks. I'm scavenging another script I have that works fine (except one other weird issue that seems timing related) so I'm a little baffled.

    It plots the first pushpin ok on ORD (Chicago) then goes to plot one on LAX (Los Angeles) and it blows up.

    I'm getting a location object by doing:

    Set objORGLoc = objMap.FindPlaceResults(org)(1)

    Where "org" was "ORD" first, then "LAX".

    Code:
    Sub plot_it(ByRef objMap, ByRef org, ByRef pushpin_desc, ByRef pushpin_note, ByRef pushpin_symbol)
    
        Set objORGLoc = objMap.FindPlaceResults(org)(1)
    
        Dim objPushpin As MapPoint.Pushpin
    
        Set objPushpin = objMap.AddPushpin(objORGLoc, pushpin_desc)
        objPushpin.Note = pushpin_note
        objPushpin.Symbol = pushpin_symbol
    
        show_balloons = True
        
        If show_balloons Then objPushpin.BalloonState = geoDisplayBalloon
        
    End Sub
    Excuse the bad programming form here and there.

    I originally had that FindPlaceResults outside the plot_it sub and passed in the object and it worked fine. I just put it in there and passed just the "org" value to see if that helped. Guess not.


    Same run-time error though. AddPushpin failed. Same numbers, etc.

    Any help is appreciated. Thanks!

    -TG

  8. #8
    Gryffyn is offline Junior Member White Belt
    Join Date
    May 2004
    Posts
    9
    Anyone ever find a solution to this problem?

    I have an Excel VBA script that gets a list of origin/destination airports for the truckers we manage and I'm trying to plot pushpins for the trucks. I'm scavenging another script I have that works fine (except one other weird issue that seems timing related) so I'm a little baffled.

    It plots the first pushpin ok on ORD (Chicago) then goes to plot one on LAX (Los Angeles) and it blows up.

    I'm getting a location object by doing:

    Set objORGLoc = objMap.FindPlaceResults(org)(1)

    Where "org" was "ORD" first, then "LAX".

    Code:
    Sub plot_it(ByRef objMap, ByRef org, ByRef pushpin_desc, ByRef pushpin_note, ByRef pushpin_symbol)
    
        Set objORGLoc = objMap.FindPlaceResults(org)(1)
    
        Dim objPushpin As MapPoint.Pushpin
    
        Set objPushpin = objMap.AddPushpin(objORGLoc, pushpin_desc)
        objPushpin.Note = pushpin_note
        objPushpin.Symbol = pushpin_symbol
    
        show_balloons = True
        
        If show_balloons Then objPushpin.BalloonState = geoDisplayBalloon
        
    End Sub
    Excuse the bad programming form here and there.

    I originally had that FindPlaceResults outside the plot_it sub and passed in the object and it worked fine. I just put it in there and passed just the "org" value to see if that helped. Guess not.


    Same run-time error though. AddPushpin failed. Same numbers, etc.

    Any help is appreciated. Thanks!

    -TG

  9. #9
    John Meyer's Avatar
    John Meyer is offline Senior Member Blue Belt
    Join Date
    Jul 2002
    Posts
    478
    I tried this code and it works ok (not an issue with "lax"). If it is a timing issue maybe try testing via ReadyStateChange event to make sure the mappoint control is not busy?

    Code:
    Dim objmap As MapPoint.Map
    Set objmap = MappointControl1.ActiveMap
    Set objORGLoc = objmap.FindPlaceResults("lax")(1)
    
    Dim objPushpin As MapPointctl.Pushpin
    Set objPushpin = objmap.AddPushpin(objORGLoc, "test")

  10. #10
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    "Run-time error '-2147467259(80004005)':

    I had the same problem when I added a pushpin. It was caused by inadvertently trying to add a pushpin with the same name as one already used. Used a unique name and the problem disappeared Mappoint happily added over 3000 pushpins with 80 different symbols
    Hope this helps
    Steve

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. addpushpin - need help to get started
    By BWard in forum MapPoint Desktop Discussion
    Replies: 7
    Last Post: 12-19-2005, 03:15 PM
  2. AddPushPin
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 03-01-2004, 11:41 AM
  3. addPushpin
    By nringdahl in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-27-2004, 10:09 AM
  4. AddPushpin with more data than Loc and name possible?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 03-17-2003, 07:11 PM
  5. AddPushpin
    By Monique in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 08-20-2002, 02:26 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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