MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




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 2006/2009 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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

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 03-05-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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
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 03-05-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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
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 01-14-2007
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:
Quote:
// 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
Quote:
privatevoid MapPoint_BeforeClose(outbool Cancel)
{
Cancel = false;
bIsRunning = false; // Global/static variable initialized to true when app starts
}
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
find, mappoint, running


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
Help!! Error running mappoint gag MapPoint 2006/2009 Discussion 1 01-27-2004 11:45 PM
I currently have Mappoint 2000 running on my PC. (.... Anonymous MapPoint 2006/2009 Discussion 1 07-11-2002 01:44 PM
I am currently running Mappoint 2001 and will buy .... Anonymous MapPoint 2006/2009 Discussion 1 09-19-2001 09:49 AM
I am currently running the MapPoint 2002 Trial. I.... Anonymous MapPoint 2006/2009 Discussion 1 09-04-2001 09:45 AM
I am currently running the MapPoint Trial. (I alre.... Anonymous MapPoint 2006/2009 Discussion 1 08-27-2001 09:13 AM


All times are GMT -5. The time now is 10:07 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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