Community of VE/MapPoint Users and Developers
This is a discussion on Closing MapPoint within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hy, Has anybody found that closing the MapPoint ActiveX control is rather "dangerous"? I have found that on one system ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Closing MapPoint Has anybody found that closing the MapPoint ActiveX control is rather "dangerous"? I have found that on one system the application closed normaly (when closing the main form that contains the ActiveX control) but on other systems, the application hangs and refuses to close. I have to use the Task Manager to kill the process What can i do? Here is the code i use to open (start) the ActiveX control and the code to close it: var Map1: TMap; procedure StartMP; begin with Form1.OLEContainer do begin DestroyObject; CreateObject('MapPoint.Map.EU.13',FALSE); DoVerb(PrimaryVerb); OleObjectInterface.GetUserClassID(vGuid); FMap := IDispatch(OleObject) as _Map; with Map1 do ConnectTo(FMap); end; end; //-------------------------- procedure CloseMP; begin Form1.Close; end; |
| |||
| Re: Closing MapPoint
I had this problem of getting MapPoint.exe to close when the VB.Net app containing the ActiveX control was closed. The solution I found was to ensure that the CloseMap method of the ActiveX control was called in the form's Closing event. Then all went well! |
| |||
| Re: Closing MapPoint
Hmmm. I'm using .Net and the control there certainly has CloseMap. All I can offer is a link to the Microsoft MSDN Library where it is described: CloseMap method My .Net projects reference the MapPoint Control 13.0 (MapPoint 2006) via: AxInterop.MapPoint.dll and Interop.MapPoint.dll |
| |||
|
My problem is that CloseMap hangs and that's why I need to close Mappoint.exe. Here's the scenario: We go thru a bunch of maps over and over and on occasion CloseMap just hangs. Currently it requires human intervention. We would like to be able to recover from this situation and close mappoint programmatically. I've tried numerous situations and none seem to be quite appropriate in this circumstance. Of note is the fact that there may be other programs on the server that are using Mappoint, so more than one MapPoint process may be running on the computer. Anyone had similar problems and/or has a solution? Thanks in advance |
| |||
| Re: Closing MapPoint
I'll have a play with that scenario (several MapPoint processes in use) and see what I can find out. This is the code I use in VB 2005 (ThisMap is a MapPoint.Map, mp is an AxMapPoint.MapPointControl) : If Not ThisMap IsNothingThen _ ThisMap.Saved = True ' Trick MapPoint into thinking it doesn't have to save the map. Try mp.CloseMap() Catch EndTry |
| |||
| Re: Closing MapPoint
Yep we do that (the saveMap I mean, either saving it or faking it out to think ie's saved), but sometimes CloseMap just dies out on us. Doesn't come back for the call for ages (overnight even). Thanks in advance for your checking on it. |
| |||
| Re: Closing MapPoint
I understand. Trust me replication has been a b*** for this problem. Sometimes you have to wait for hours for the problem to occur on a non-debugging machine. LOL If anyone else has any ideas, I'm willing to listen. |
![]() |
| Tags |
| closing, mappoint |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MapPoint crashs after closing the application | Elbarto | MapPoint 2006/2009 Discussion | 12 | 12-30-2006 10:47 PM |
| mapPoint 2006 activex control slow down form closing | bule | MapPoint 2006/2009 Discussion | 1 | 09-26-2006 02:22 PM |
| Disabling closing of MapPoint? | MD2000 | MapPoint 2006/2009 Discussion | 1 | 05-09-2005 05:57 PM |
| Closing: MapPoint process stilll running | MD2000 | MapPoint 2006/2009 Discussion | 4 | 04-29-2005 09:58 AM |
| Closing without saving | Mudrover | MapPoint 2006/2009 Discussion | 1 | 01-30-2005 08:49 AM |