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

How to clean up mappoint objects the right way?

This is a discussion on How to clean up mappoint objects the right way? within the MapPoint Desktop Discussion forums, part of the Map Forums category; VC++ Mappoint2006 COM/ActiveX Hi guys, When I close my app, I need to remove the objects on the right way ...

  1. #1
    VC_Man is offline Member Green Belt
    Join Date
    Nov 2006
    Posts
    93

    How to clean up mappoint objects the right way?

    VC++
    Mappoint2006
    COM/ActiveX

    Hi guys,

    When I close my app, I need to remove the objects on the right way before it closes. But somehow I don't do that the right way, exits the thread (in mappoint) with code 27 (0x1B)
    Does anyone know how to close Mappoint the right way? Normally I assume it deletes itself from memory. But I've also seen the Quit member of CApplication. How do I have to close the mappoint com?

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

    Re: How to clean up mappoint objects the right way?

    Hi,

    Using the object model, I think it is Application.Quit. In Delphi you have to destroy the object where mappoint is in. I assume in C++ more or less the same. If you use the ActiveX control you have nothing to do. It will destroyed by the owner of it which is normally the from where it sits on (unless you create the ActiveX programatically, then you have to destroy it yourself).

  3. #3
    VC_Man is offline Member Green Belt
    Join Date
    Nov 2006
    Posts
    93

    Re: How to clean up mappoint objects the right way?

    Thanks for your reply Wilfried,

    I've asked this question because I see Mappoint exits with code 27 (0x1B), and I guess it's not the right way (the right way is with code 0 (0x0) ?).
    My app doesn't crash or something, also I've no memory-leaks, but I tought it's better to quit the app on a neat way.

  4. #4
    VC_Man is offline Member Green Belt
    Join Date
    Nov 2006
    Posts
    93

    Re: How to clean up mappoint objects the right way?

    Hello guys,

    I now know what the problem is. The message-"errors" look more critical than it actually is. Generally exitcode of threads are 0 (0x0), this mean that the thread has exited succesfully. Well when I get the exitcode e.g. 27, it means that Mappoint hasn't exited the thread on the right way.

    So in my situation, somewhere in my code I tried to delete an object that doesn't exist. Thus it's not so catastrophic as it looks like. VB.NET and C#.NET use garbage collections, which frees allocated memory automagically. But like C++ I need to be aware of allocated memory and have to delete manually, but if I tought I've allocated memory, which is not, than I "freed" memory while there is nothing to free. And Mappoint is trying to destroy an object, trying, trying, but it can't. So Mappoint terminate himself with an additonal message (27) which means "I've done that, but something went wrong".

    Thank you!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Display Moving objects on Map in ASP.net
    By whenry6000 in forum Bing Maps and MapPoint Web Service
    Replies: 2
    Last Post: 01-17-2007, 02:47 PM
  2. Using MapPoint within a Visual Objects (CA) Application
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 04-26-2004, 10:21 AM
  3. MP2K in VB6: objects on top of the mappoint control?
    By larry_llama in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 12-23-2002, 01:13 AM
  4. specify label to all the objects of a layer
    By Anonymous in forum Wish List
    Replies: 0
    Last Post: 08-28-2002, 08:22 AM
  5. i am using mappoint 2002 objects to build a com. i....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 09-20-2001, 07:22 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