Community of MapPoint and Virtual Earth Users and Developers
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 ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| 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 |
| |||
|
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.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| 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. |
![]() |
| Tags |
| application, closing, crashs, mappoint |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| 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 |
Zante Holidays
Enjoy lovely sandy beaches when you take your Zante holidays booked through UlookUbook!