Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 9 of 9

Closing MapPoint

This is a discussion on Closing MapPoint within the MapPoint Desktop 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 ...

  1. #1
    pepumarius is offline Junior Member White Belt
    Join Date
    Apr 2007
    Posts
    5

    Closing MapPoint

    Hy,

    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 . I mention that i use MapPoint 2006.

    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;

  2. #2
    Quin is offline Junior Member White Belt
    Join Date
    Oct 2006
    Posts
    8

    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!

  3. #3
    pepumarius is offline Junior Member White Belt
    Join Date
    Apr 2007
    Posts
    5

    Re: Closing MapPoint

    Hy... But i don't have a CloseMap method... in the ActiveX control that is installed on Delphi there is no such method.

  4. #4
    Quin is offline Junior Member White Belt
    Join Date
    Oct 2006
    Posts
    8

    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

  5. #5
    MappointNewbie is offline Junior Member White Belt
    Join Date
    Aug 2008
    Posts
    6

    Question Re: Closing MapPoint

    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

  6. #6
    Quin is offline Junior Member White Belt
    Join Date
    Oct 2006
    Posts
    8

    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

  7. #7
    MappointNewbie is offline Junior Member White Belt
    Join Date
    Aug 2008
    Posts
    6

    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.

  8. #8
    Quin is offline Junior Member White Belt
    Join Date
    Oct 2006
    Posts
    8

    Re: Closing MapPoint

    Well, I've tried running several copies of my app simultaneously, along with opening MapPoint in the normal way. All these processes closed down properly.
    Sorry I can't be of more help.

  9. #9
    MappointNewbie is offline Junior Member White Belt
    Join Date
    Aug 2008
    Posts
    6

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. MapPoint crashs after closing the application
    By Elbarto in forum MapPoint Desktop Discussion
    Replies: 12
    Last Post: 12-30-2006, 10:47 PM
  2. mapPoint 2006 activex control slow down form closing
    By bule in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-26-2006, 02:22 PM
  3. Disabling closing of MapPoint?
    By MD2000 in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-09-2005, 05:57 PM
  4. Closing: MapPoint process stilll running
    By MD2000 in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 04-29-2005, 09:58 AM
  5. Closing without saving
    By Mudrover in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-30-2005, 08:49 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96