Community of VE/MapPoint Users and Developers
This is a discussion on How to clean up mappoint objects the right way? within the MapPoint 2006/2009 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 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| How to clean up mappoint objects the right way? 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? |
| |||
| 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).
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| 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. |
| |||
| 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! |
![]() |
| Tags |
| clean, mappoint, objects |
| ||||
| Posted By | For | Type | Date | |
| Using Python to Control MapPoint, Part 1 - MapPoint Articles - MP2K Magazine | This thread | Refback | 02-16-2007 02:07 AM | |
| Making Pushpin Locations Immoveable - MapPoint Articles - MP2K Magazine | This thread | Refback | 02-14-2007 10:30 AM | |
| Programming MapPoint in .NET - MP2K Magazine | This thread | Refback | 02-13-2007 03:40 PM | |
| Snap to a Road - MapPoint Articles - MP2K Magazine | This thread | Refback | 02-13-2007 12:06 PM | |
| Microsoft MapPoint 2006 - MP2K Magazine | This thread | Refback | 02-08-2007 08:30 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Display Moving objects on Map in ASP.net | whenry6000 | MapPoint Web Service and Virtual Earth | 2 | 01-17-2007 02:47 PM |
| Using MapPoint within a Visual Objects (CA) Application | Anonymous | MapPoint 2006/2009 Discussion | 0 | 04-26-2004 10:21 AM |
| MP2K in VB6: objects on top of the mappoint control? | larry_llama | MapPoint 2006/2009 Discussion | 5 | 12-23-2002 01:13 AM |
| specify label to all the objects of a layer | Anonymous | Wish List | 0 | 08-28-2002 08:22 AM |
| i am using mappoint 2002 objects to build a com. i.... | Anonymous | MapPoint 2006/2009 Discussion | 1 | 09-20-2001 07:22 AM |