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

garbage collection

This is a discussion on garbage collection within the MapPoint Desktop Discussion forums, part of the Map Forums category; I am having trouble with garbage collection, I wonder if anyone can help... Using MP2004 OCX, vb5 I've read the ...

  1. #1
    SimonPearse is offline Junior Member Yellow Belt
    Join Date
    Jun 2004
    Posts
    15

    garbage collection

    I am having trouble with garbage collection, I wonder if anyone can help...
    Using MP2004 OCX, vb5

    I've read the articles about forcing garbage collection by using the Sendmessage API call, and getting the hwnd of the mappoint control via Sergiy Pavlov's code.

    so I started with sergiys program http://www3.sympatico.ca/spavlov/mappoint_extended.zip
    and added the deffinition
    Public Const SC_MINIMIZE = &HF020

    and a command button

    Private Sub Command1_Click()
    Dim TWnd As New TWindow
    Dim lResult As Long

    TWnd.hwnd = objMap.hWnd_Frame
    lResult = SendMessage(TWnd.hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0)

    End Sub

    Clicking the button seems to do nothing, no minimise, no change in memory useage, what am I doing wrong?!

  2. #2
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    It may not work with a control.

    Also that code finds the window by looking for a window with the correct title bar. So that needs a MapPoint application rather than a control.
    (and you have to use the correctly title text)

    You could try minimising the window that is holding the control? I don't know if that works, but it might force the control to minimise?
    I suspect it won't, but it is definitely worth a try.


    Richard
    Winwaed Software Technology LLC
    http://www.winwaed.com
    See http://www.mapping-tools.com for MapPoint Tools

  3. #3
    SimonPearse is offline Junior Member Yellow Belt
    Join Date
    Jun 2004
    Posts
    15
    thanks for the response.
    Minimising the form deffinately does not work.
    I have also tried using api calls to get the controls hwnd and snding a minimise to it, all to no avail.
    This is cripling my software!
    Any other suggestions?

  4. #4
    Winwaed's Avatar
    Winwaed is offline Mapping-Tools.com Black Belt
    Join Date
    Feb 2004
    Location
    Irving,Texas
    Posts
    1,859
    Blog Entries
    60
    I think you're in new territory here!

    Another area where you can't force the garbage control using this method, is from an add-in.


    One option might be to split your MapPoint working into two processes? The intensive memory-growing stuff is in an application?

    Or to close and restart MapPoint on a regular basis?


    Richard
    Winwaed Software Technology LLC
    http://www.winwaed.com
    See http://www.mapping-tools.com for MapPoint Tools

  5. #5
    SimonPearse is offline Junior Member Yellow Belt
    Join Date
    Jun 2004
    Posts
    15
    The whole thing is one large vb5 application, in use 24/7, with one momentary shutdown at 04:30. The problem with opening/closing the maps is that by the time they have a good few pushpins and shapes drawn the close/open process (on a p4 2.4Ghz, 512M RAM) is typicaly taking 5-10 seconds, which seriously irritates operators.

  6. #6
    Blackbird is offline Junior Member White Belt
    Join Date
    Nov 2006
    Posts
    4

    Re: garbage collection

    Hi,

    I'm using MapPoint 2004 in an activeX control, and I need to execute garbage collection.

    I'm using it in 2 separate application : 1 written en C# and the other in Java.

    Questions :
    - Is there better way to free memory than saving+opening the map, or sending a minimize message?
    - If there is not, how to send a minimize/restore message in C# and Java?
    - Will the MP memory usage be reduced by the OS when all RAM is used and the user then uses/launches other apps thus needing more memory? (If yes, I won't bother with this problem)

    Thanks in advance for any help.

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

    Re: garbage collection

    Hi,

    You dont need to send/post a message, just set the property in your application if you use the activeX control:

    Code:
    WindowState = FormWindowState.Minimized;

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Garbage collection
    By daxydoggie in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 05-04-2005, 01:35 PM
  2. This forum is GARBAGE !!!
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 4
    Last Post: 12-30-2004, 02:53 PM
  3. Garbage Anyone?
    By daxydoggie in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 11-22-2004, 11:16 AM
  4. requested member of collection does not exist
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 11-16-2004, 08:22 AM
  5. limiting objects in collection
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 04-27-2004, 08:52 AM

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