MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




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


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack (5) Thread Tools Display Modes
  5 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 02-07-2007
Member
Green Belt
 
Join Date: Nov 2006
Posts: 87
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?
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 02-07-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
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).
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 02-08-2007
Member
Green Belt
 
Join Date: Nov 2006
Posts: 87
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.
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 02-08-2007
Member
Green Belt
 
Join Date: Nov 2006
Posts: 87
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!
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

Tags
clean, mappoint, objects


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/how-clean-up-mappoint-objects-right-way-5655.html

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

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


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


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


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