Community of VE/MapPoint 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 ...
| |||||||
| 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 |
![]() |
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 |
Flights from Birmingham
Here at Holiday Hypermarket you can book fantastic cheap flights from Birmingham Airport. Check out the great range of destinations.
Best Travel Agent
Travel Counsellors has been named the UK's Best Travel Agent at the Guardian Unlimited Travel awards.
Cuba Holiday
A Cuba Holiday has so much to offer with numerous different cultures affecting the sights, sounds and tastes. Visit this fascinating country with dealchecker.co.uk.
Holidays to Dominican Republic
Holidays to Dominican Republic offer a wealth of natural beauty and magnificent views. Come alive in the splendor of the Dominican Republic!
Portugal
As well as providing some great weather Portugal has much to offer culturally. There are numerous museums, monuments and places of historical interest to explore. Despite the rich history there is a buzzing nightlife and great shopping too.
Compare Holidays
Compare holidays online where you can see all the amazing possibilities at Travel.co.uk
Holidays in Sharm el Sheikh
Need booking info on holidays in Sharm el Sheikh? Visit On The Beach for more information!