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
Results 1 to 8 of 8

Finding MapPoint process

This is a discussion on Finding MapPoint process within the MapPoint Desktop 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 program ...

  1. #1
    Marin is offline 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.

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    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.

  3. #3
    Marin is offline 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?

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Finding MapPoint process

    Hi,

    app is exclusive address to the object. So you can use the app variable.

  5. #5
    Marin is offline 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?

  6. #6
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    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...

  7. #7
    Marin is offline 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?

  8. #8
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: Finding MapPoint process

    Hi,

    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.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Mappoint as background process for Filemaker Pro App
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 8
    Last Post: 03-12-2008, 02:04 PM
  2. Closing: MapPoint process stilll running
    By MD2000 in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 04-29-2005, 09:58 AM
  3. MP process priority
    By mgravell in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 03-24-2005, 01:38 PM
  4. Waiting for shutdown of mappoint process
    By Gauloisid in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-27-2003, 08:46 AM
  5. I am new to map point. I am in the process of doi....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-01-2002, 03:09 PM

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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96