Community of MapPoint and Virtual Earth Users and Developers
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; Hello, I create a MapPointApplication with the following code: Code: ApplicationClass mapPointApplication = new ApplicationClass(); Then I add pushpins to ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| C#: How to find out if MapPoint is still running? I create a MapPointApplication with the following code: Code: ApplicationClass mapPointApplication = new ApplicationClass(); Code: mapPointApplication.ActiveMap.AddPushpin(location, "1"); How can I check if MapPoint is still running and hasn't been closed by the user? Bye, MD |
| |||
|
Hi, Something like this: Code: using System.Diagnostics;
private bool IsMPRunning()
{
Process[] processes = Process.GetProcessesByName("MapPoint");
return (processes.Length > 0);
}
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Hi, I cannot find ApplicationClass in my help Code: private bool IsThisOneRunning(IntPtr h)
{
Process[] processes = Process.GetProcessesByName("MapPoint");
foreach (Process proc in processes)
if (proc.Handle == h)
return true;
return false;
}
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
I thought about something like this: Code: mapPointApplication.BeforeClose += new MapPoint._ApplicationEvents_BeforeCloseEventHandler(mapPoint_Closing); I'm not so familiar with eventhandler. Do you know how add the right event handler for the beforeclose Event? Bye, MD |
| |||
|
Here's the Visual Basic code from the MapPoint help: Code: Dim WithEvents objApp As MapPoint.Application
Private Sub Command1_Click()
'Refresh the map using NewMap
objApp.NewMap
End Sub
Private Sub Form_Load()
'Set up the application
Set objApp = CreateObject("mappoint.application")
objApp.Visible = True
objApp.UserControl = True
End Sub
Private Sub objApp_BeforeClose(Cancel As Boolean)
MsgBox "BeforeClose event fired"
End Sub
Bye, MD |
| |||
|
Hi, I'm not sure: Code: public void Map_BeforeClose(ref bool Cancel); new MapPoint._ApplicationEvents_BeforeCloseEventHandler(Map_BeforeClose)
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
It says: Method 'server.ServerGUI.mapPoint_Closing(ref bool)' doesnt comply with the Delegat 'void MapPoint._ApplicationEvents_BeforeCloseEventHandle r(out bool)'. Any idea? I'm totally lost with the delegat and out thing. Bye, MD |
| |||
|
Hi, Try with Ref bool
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| find, mappoint, running |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help!! Error running mappoint | gag | MapPoint 2006/2009 Discussion | 1 | 01-27-2004 10:45 PM |
| I currently have Mappoint 2000 running on my PC. (.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 07-11-2002 12:44 PM |
| I am currently running Mappoint 2001 and will buy .... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 09-19-2001 08:49 AM |
| I am currently running the MapPoint 2002 Trial. I.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 09-04-2001 08:45 AM |
| I am currently running the MapPoint Trial. (I alre.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 08-27-2001 08:13 AM |
Lanzarote Holiday
Enjoy a Lanzarote holiday when you check out the offers on UlookUbook and save cash!