Community of MapPoint and Virtual Earth Users and Developers
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 ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| addpushpin problem 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 |
| ||||
|
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 |
| |||
|
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 |
| ||||
|
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 |
| |||
|
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 |
| |||
|
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 |
| |||
|
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
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 |
| |||
|
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
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 |
| ||||
|
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 |
| |||
| "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 |
![]() |
| Tags |
| addpushpin, problem |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| 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 |
Thassos Holidays
Visit an unspoilt and beautiful Greek island with Thassos holidays available through UlookUbook.