Community of VE/MapPoint Users and Developers
This is a discussion on software crashes when I try to delete a shape within the Development forums, part of the MapPoint 2006/2009 Discussion category; I am writing my code in C++ and at this point all I want to do is add a line ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| software crashes when I try to delete a shape void MapPt:: DrawLine(double Lat1, double Long1, double Lat2, double Long2) { //create a location object for each point WyptLocPtr1 = m_myMap->GetLocation( Lat1, Long1, 4 ); locWypt1 = (Location*)WyptLocPtr1; WyptLocPtr2 = m_myMap->GetLocation( Lat2, Long2, 4 ); locWypt2 = (Location*)WyptLocPtr2; //create a shapes object NavLinesPtr = m_myMap->GetShapes(); NavLines = (Shapes*)NavLinesPtr; Shape* L; L = NavLines->AddLine(locWypt1,locWypt2); } After I have created this line on the map I cannot delete it though. To delete I just use the following code: Line->Delete() My software just crashes here, and the error I get is access violation. Any help here would be much appreciated. |
| ||||
| Re: software crashes when I try to delete a shape
Sounds like your pointer is no longer valid. (I assume you meant "L" and not "Line"?) Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009 |
| |||
| Re: software crashes when I try to delete a shape
Here is my working code: void MapPt:: DrawLine(double Lat1, double Long1, double Lat2, double Long2) { //first must create a location object for each point WyptLocPtr1 = m_myMap->GetLocation( Lat1, Long1, 4 ); locWypt1 = (Location*)WyptLocPtr1; WyptLocPtr2 = m_myMap->GetLocation( Lat2, Long2, 4 ); locWypt2 = (Location*)WyptLocPtr2; //create a shape object NavLinesPtr = m_myMap->GetShapes(); NavLines = (Shapes*)NavLinesPtr; //draw line LinePtr = NavLines->AddLine(locWypt1,locWypt2); Line = (Shape*)LinePtr; } To delete the line all I do is call: LinePtr->Delete(); |
![]() |
| Tags |
| crashes, delete, shape, software |
| ||||
| Posted By | For | Type | Date | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 11-29-2007 10:17 AM | |
| dahranis » software crashes when I try to delete a shape | This thread | Pingback | 11-26-2007 01:23 PM | |
| Apple Blog » Blog Archive » software crashes when I try to delete a shape | This thread | Pingback | 11-26-2007 11:41 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ERP Software - Looking For ERP Software Solution For Ladies Garment Manufacturer | fashion4u | News and Announcements | 1 | 06-10-2008 10:19 AM |
| Does an object reside in my Shape or Shape boundaries? | hotrdd | MapPoint 2006/2009 Discussion | 1 | 08-04-2005 10:51 PM |
| Consumers Trust Software Makers to Develop Car Software | Eric Frost | News and Announcements | 0 | 04-17-2005 09:06 AM |
| Help crashes | glshrike | MapPoint 2006/2009 Discussion | 1 | 02-03-2004 02:57 PM |
| Control Crashes - Help !!! | dougw | MapPoint 2006/2009 Discussion | 1 | 04-10-2003 09:29 AM |