MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




MapPoint crashs after closing the application

This is a discussion on MapPoint crashs after closing the application within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I have this same problem with Mappoint sometimes crashing when exiting. I have developed an applicaiton that uses VB .NET ...


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
  #11 (permalink)  
Old 06-07-2006
Junior Member
White Belt
 
Join Date: Jun 2006
Posts: 1
Mapoint Crashs on Exit

I have this same problem with Mappoint sometimes crashing when exiting. I have developed an applicaiton that uses VB .NET 2002 and the active x component of Mappoint to display a map.

I use the ActiveMap.Saved = true, AcitveMap.Application.quit and .closemap functions but I still get an error when the application closes.

I don't know of any mean to post a message to mappoint through the acitve x component to close out Mappoint.exe.

Is there other options with an active x component to get this to quit happening?

Terry
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12 (permalink)  
Old 06-13-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
Hi,

You dont need to AcitveMap.Application.quit if you close your application using the AcitveX component. That is probably the reason of your error.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13 (permalink)  
Old 12-30-2006
Junior Member
White Belt
 
Join Date: Dec 2006
Posts: 2
Re: MapPoint crashs after closing the application

I've had this problem for a while and finally figured it out...

Most calls to the MapPoint object return a COM object that must be cleaned up properly. In my case, I wasn't properly handling them as they were created. Here's the code that was causing MapPoint to crash when exited:

MapPoint.Application g_oApp = (MapPoint.Application) applicationObject;

object pp = g_oApp.ActiveMap.ShowFindDialog("101 The City Dr S, Orange, CA", MapPoint.GeoFindState.geoFindAddress, 0, false);

if (pp != null)
{
if (pp is MapPoint.Pushpin)
{
g_oApp.ActiveMap.Route.Add((MapPoint.Pushpin) pp, loc.fac);
}
ReleaseObject(pp);
}

The problem is that the call to g_oApp.ActiveMap.ShowFindDialog(...) creates a Map and push-pin object (assuming an address was selected in the Find dialog box).

Also, g_oApp.ActiveMap.Route.Add(...) creates another Map object as well as Route and Waypoint objects. In order to clean everything up properly, the objects must be maintained as follows:

// Add the waypoint to the current route
MapPoint.Application g_oApp = (MapPoint.Application) applicationObject;
MapPoint.Map map = g_oApp.ActiveMap;
MapPoint.Route route = map.ActiveRoute;
route.Clear();
// Clear out old route if any

// Display the find dialog
object pp = map.ShowFindDialog("101 The City Dr S, Orange, CA, 92868", MapPoint.GeoFindState.geoFindAddress, 0, false);


// Is the location a valid push-pin?
if (pp != null)
{
if (pp is MapPoint.Pushpin)
{
MapPoint.Waypoints wp = route.Waypoints;
MapPoint.Waypoint p = wp.Add((MapPoint.Pushpin) pp, loc.fac);
ReleaseObject(p);
ReleaseObject(wp);
}
ReleaseObject(pp);
}

ReleaseObject(route);
ReleaseObject(map);

Hope this helps.
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
application, closing, crashs, mappoint


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
Disabling closing of MapPoint? MD2000 MapPoint 2006/2009 Discussion 1 05-09-2005 04:57 PM
Closing: MapPoint process stilll running MD2000 MapPoint 2006/2009 Discussion 4 04-29-2005 08:58 AM
Closing Without Saving A territory map Yazzy MapPoint 2006/2009 Discussion 3 04-27-2005 02:26 PM
Closing without saving Mudrover MapPoint 2006/2009 Discussion 1 01-30-2005 07:49 AM
I am trying to use the Mappoint in my application .... Anonymous MapPoint 2006/2009 Discussion 1 12-03-2001 09:53 PM


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

Zante Holidays
Enjoy lovely sandy beaches when you take your Zante holidays booked 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