MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




addpushpin problem

This is a discussion on addpushpin problem within the MapPoint 2006/2009 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 ...


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 09-17-2002
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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
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 09-18-2002
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
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.
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
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 09-18-2002
Junior Member
White Belt
 
Join Date: Sep 2002
Posts: 7
Send a message via ICQ to Joeba Send a message via MSN to Joeba
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
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 09-18-2002
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
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.
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 09-19-2002
Junior Member
White Belt
 
Join Date: Sep 2002
Posts: 7
Send a message via ICQ to Joeba Send a message via MSN to Joeba
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 09-19-2002
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 07-14-2004
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 07-14-2004
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 07-16-2004
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
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")
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 09-28-2004
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
"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
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
addpushpin, 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
addpushpin - need help to get started BWard MapPoint 2006/2009 Discussion 7 12-19-2005 02:15 PM
AddPushPin Anonymous MapPoint 2006/2009 Discussion 0 03-01-2004 10:41 AM
addPushpin nringdahl MapPoint 2006/2009 Discussion 1 01-27-2004 09:09 AM
AddPushpin with more data than Loc and name possible? Anonymous MapPoint 2006/2009 Discussion 5 03-17-2003 06:11 PM
AddPushpin Monique MapPoint 2006/2009 Discussion 3 08-20-2002 01:26 AM


All times are GMT -5. The time now is 02:33 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

Thassos Holidays
Visit an unspoilt and beautiful Greek island with Thassos holidays available through UlookUbook.



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