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
Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

C#: How to find out if MapPoint is still running?

This is a discussion on C#: How to find out if MapPoint is still running? within the MapPoint Desktop Discussion forums, part of the Map Forums category; In a separate thread create a process object and assign it to mappoint. Then use the process.waitforexit method followed by ...

  1. #11
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    On Exit

    In a separate thread create a process object and assign it to mappoint. Then use the process.waitforexit method followed by a line which tells you that mappoint was closed.

    Now can you help me reference both versions of mappoint in .net?

    Cheers,
    Nick

  2. #12
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    Code

    Off the top of my head:

    Sub RunningOnAnotherThread()
    Dim p() As Process = Process.GetProcessesByName("MapPoint")
    If p.GetUpperBound(0) > 0 Then
    p(0).WaitForExit() <--execution blocked here until exit
    MsgBox("MapPoint was closed!!!")
    End If
    End Sub

  3. #13
    Aaaron16 is offline Junior Member White Belt
    Join Date
    Dec 2006
    Posts
    2

    Re: C#: How to find out if MapPoint is still running?

    using C#...

    Register for the event here:
    // g_oApp is a MapPoint.Application object
    g_oApp.BeforeClose +=new MapPoint._ApplicationEvents_BeforeCloseEventHandle r(MapPoint_BeforeClose);
    Then use the event handler to keep track of the application state
    privatevoid MapPoint_BeforeClose(outbool Cancel)
    {
    Cancel = false;
    bIsRunning = false; // Global/static variable initialized to true when app starts
    }

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help!! Error running mappoint
    By gag in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-27-2004, 11:45 PM
  2. I currently have Mappoint 2000 running on my PC. (....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-11-2002, 01:44 PM
  3. I am currently running Mappoint 2001 and will buy ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-19-2001, 09:49 AM
  4. I am currently running the MapPoint 2002 Trial. I....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-04-2001, 09:45 AM
  5. I am currently running the MapPoint Trial. (I alre....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 08-27-2001, 09:13 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