MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Finding MapPoint process

This is a discussion on Finding MapPoint process within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I have several istances of MapPoint.exe running at the same time, each one corresponding to one instance of a ...


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  13 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 05-03-2007
Junior Member
White Belt
 
Join Date: Apr 2007
Posts: 6
Finding MapPoint process

I have several istances of MapPoint.exe running at the same time, each one corresponding to one instance of a program i wrote. How can i identify which MapPoint.exe corresponds to a specific instance of a program?
I need it so that I could trac memory usage.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 05-03-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,017
Re: Finding MapPoint process

Hi,

When you create the mappoint application the windows handle is returned. You could keep track of it. Remember windows handles are exclusive but not exclusive in time. If application shut down then the same handle can be something else a while later.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 05-03-2007
Junior Member
White Belt
 
Join Date: Apr 2007
Posts: 6
Re: Finding MapPoint process

Quote:
Originally Posted by Wilfried View Post
When you create the mappoint application the windows handle is returned. You could keep track of it. Remember windows handles are exclusive but not exclusive in time. If application shut down then the same handle can be something else a while later.
Well i create the application with the following code
Code:
MapPoint.ApplicationClass app= new MapPoint.ApplicationClass();
How can I get the handle from that?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 05-04-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,017
Re: Finding MapPoint process

Hi,

app is exclusive address to the object. So you can use the app variable.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 05-04-2007
Junior Member
White Belt
 
Join Date: Apr 2007
Posts: 6
Re: Finding MapPoint process

Quote:
Originally Posted by Wilfried View Post
app is exclusive address to the object. So you can use the app variable.
Yes, but how can I determin memory usage of MapPoint.exe from the app object?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 05-04-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,017
Re: Finding MapPoint process

Hi,

I'm not sure.

Code:
Process[] processes = Process.GetProcessesByName("MapPoint");
foreach (Process proc in processes)
    if (proc.Handle == app)
But I'm not sure if the handle of the process is the same as the value of app. It can be the address of it. So if not I'm stuck as well.

Second thing is the memory application. proc has several properties for that. PagedMemorySize, NonPagedMemorySize etc...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 05-04-2007
Junior Member
White Belt
 
Join Date: Apr 2007
Posts: 6
Re: Finding MapPoint process

Quote:
Originally Posted by Wilfried View Post
Hi,

I'm not sure.

Code:
Process[] processes = Process.GetProcessesByName("MapPoint");
foreach (Process proc in processes)
    if (proc.Handle == app)
But I'm not sure if the handle of the process is the same as the value of app. It can be the address of it. So if not I'm stuck as well.
proc.Handle and app are not comparable types so this can't work.

So, maybe, this workaround is the best that can be done.
Code:
Process thisProcess = Process.GetCurrentProcess();
app.Caption = thisProcess.Id.ToString();
Process[] procesi = Process.GetProcessesByName("MapPoint");
foreach (Process p in procesi)
{
    if (p.MainWindowTitle == "Map - "+thisProcess.Id.ToString())
    {
        //p is the one
    }
}
Can it be done easier?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 05-04-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,017
Re: Finding MapPoint process

Hi,

Quote:
proc.Handle and app are not comparable types so this can't work.
Both are unsigned 32 bit numbers. So you can typecast them to int or to IntPtr to compare. Worth to try and see if the number is the same

I dont know if there is other / simpler solution as the one you do. But seems ok if it works of course.
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


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/finding-mappoint-process-5859.html

Posted By For Type Date
Programming MapPoint via .NET - MapPoint Articles - MP2K Magazine This thread Refback 05-22-2007 10:33 AM
Using MapPoint In Delphi - MapPoint Articles - MP2K Magazine This thread Refback 05-14-2007 01:34 PM
Snap to a Road - MapPoint Articles - MP2K Magazine This thread Refback 05-14-2007 01:24 PM
Delphi Address Verifier - MapPoint Articles - MP2K Magazine This thread Refback 05-14-2007 01:22 PM
An API to Control MapPoint 2006 GPS Features - Part I of II - MapPoint Articles - MP2K Magazine This thread Refback 05-10-2007 06:59 PM
Using MapPoint In Delphi - MapPoint Articles - MP2K Magazine This thread Refback 05-10-2007 02:24 PM
Using MapPoint In Delphi - MapPoint Articles - MP2K Magazine This thread Refback 05-10-2007 02:18 PM
Extending the MapPoint ActiveX Control - Pt. I - MapPoint Articles - MP2K Magazine This thread Refback 05-09-2007 12:06 PM
Pocket Streets Conversion Tool Made Available - MapPoint News - MP2K Magazine This thread Refback 05-09-2007 11:09 AM
Working With Excel and MapPoint - MP2K Magazine This thread Refback 05-08-2007 12:33 AM
MapPoint Articles - MP2K Magazine This thread Refback 05-07-2007 03:04 PM
Pennsylvania Map and Map of Pennsylvania - MapPoint State Map Gallery - MP2K Magazine This thread Refback 05-07-2007 04:37 AM
Microsoft MapPoint 2006 - MP2K Magazine This thread Refback 05-04-2007 12:46 AM

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
Mappoint as background process for Filemaker Pro App Anonymous MapPoint 2006/2009 Discussion 8 03-12-2008 01:04 PM
Closing: MapPoint process stilll running MD2000 MapPoint 2006/2009 Discussion 4 04-29-2005 08:58 AM
MP process priority mgravell MapPoint 2006/2009 Discussion 2 03-24-2005 12:38 PM
Waiting for shutdown of mappoint process Gauloisid MapPoint 2006/2009 Discussion 1 10-27-2003 07:46 AM
I am new to map point. I am in the process of doi.... Anonymous MapPoint 2006/2009 Discussion 1 07-01-2002 02:09 PM


All times are GMT -5. The time now is 01:20 PM.


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

Ski Holidays Austria
Ski holidays in Austria offer ski schools for all types of skiers. They range from beginner classes of all ages to more advanced classes. Learn new techniques and refresh skills.

Travel Counselors
Travel Counselors are an award winning Travel Agent. Why not have a personal Travel Counselor help with your travel plans.

Holidays Jamaica
Holidays to Jamaica are a great way to immerse yourself in a different culture. Soak up some sun, indulge in some shopping, and relax at a beach resort. Use dealchecker.co.uk.

Holidays in Cyprus
Holidays in Cyprus are enriched by the abundance of churches, ruins and natural wonders. Book a holiday with us today!

Canaries
Find out all about the Canaries when you check out the ulookubook.com travel guides. Not only can you get a great holiday deal but you can find out useful information about potential holiday destinations.

Cheap family holidays
To plan cheap family holidays, use Travel.co.uk to explore all the delightful possibilities that there are.

Cheap holidays to Portugal
Enjoy a spectacular country at a fraction of the cost. Find information on cheap holidays to Portugal at On The Beach.


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