MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Access Violation

This is a discussion on Access Violation within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I have a vc++ dialog app with dialogs in a tab control. One of the dialogs has the mappoint control ...


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-11-2003
Junior Member
White Belt
 
Join Date: Feb 2003
Posts: 3
Access Violation

I have a vc++ dialog app with dialogs in a tab control. One of the dialogs has the mappoint control in it. When I try to call m_mappointcontrol->NewMap(northamerica) I get an access violation. I can only call the NewMap from a button on the actual dialog with the mappoint control.

Have you seen this behavior? Has anyone found a solution?

thanks in advance
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 05-25-2005
Junior Member
White Belt
 
Join Date: May 2005
Posts: 9
NewMap access violation

I, too, get an access violation after I create a NewMap in my application. I made it so that when my app starts up, the MappointCtrl is hidden and there is a CListCtrl shown in the same place. I have a button that shows the MappointCtrl and hides the CListCtrl. The map shows up fine. And the first time I run the application after doing a "Rebuild All" it runs fine. But every time I run it after that I get an Access Violation and it shows me the dissassembly (which doesn't really help me figure out what's going on).

Code:
void CMainFrame::OnMapView( ) {
	CRouteProgressView* pRPV   = NULL;
	CRoadRunnerMobileApp* pApp = (CRoadRunnerMobileApp*)AfxGetApp();

	if (pApp != NULL)
		pRPV = pApp->pProgressView; // pointer to the dialog class with the controls
	else
		return;

	CListCtrl     *list = pRPV->getListCtrl();
	CMappointCtrl *map  = pRPV->getMapCtrl();

	if( !map->IsWindowVisible() ) {
		list->ShowWindow( SW_HIDE );	
		map->ShowWindow( SW_SHOW );
		map->SetActiveWindow();
		pRPV->createNewMap();
	} else {
		map->CloseMap();
		list->ShowWindow( SW_SHOW );	
		map->ShowWindow( SW_HIDE );
	}

}

--------------------------------
class CRouteProgressView : public CFormView
{
...
	CMappointCtrl* getMapCtrl()  { return &m_Map; };
	CListCtrl*     getListCtrl() { return &m_List; };
	void createNewMap() {
		VARIANT a;
		a.vt = VT_I4;
		a.lVal = 1; // 1 for America 2 for geoMapEurope!
		m_Map.NewMap(a);
	};
...}
Any ideas? Thanks!
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 05-25-2005
Junior Member
White Belt
 
Join Date: Feb 2003
Posts: 3
access violation, NewMap

The interface changes in the .net ide aka (vc++7.0) and fixes this.
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 05-26-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Re: Access Violation

Hi,

Quote:
Originally Posted by dcarl
I have a vc++ dialog app with dialogs in a tab control. One of the dialogs has the mappoint control in it. When I try to call m_mappointcontrol->NewMap(northamerica) I get an access violation. I can only call the NewMap from a button on the actual dialog with the mappoint control.
You mean the dialog is created but not visible ? Yes, if that's the case you must show it (modal or not), then load the map and eventually hide it if you want. If you dont want to have the map visible for a moment you can make it zero pixels height/width, or put another control above it.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 05-26-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Re: NewMap access violation

Hi,

Quote:
Originally Posted by discostu
the first time I run the application after doing a "Rebuild All" it runs fine. But every time I run it after that I get an Access Violation
There is no difference between the first run after a rebuild and supsequent runt, however it is possible that you still have a mappoint instance running in memory for a while, if your application does not do a nice cleanup for some reason.

Eventually check with task manager, or make a small application that remove all mappoint instances out of memory before a second run to see if that is the reason.

To remove all mappoint instances there is example of it in FAQ.
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


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


All times are GMT -5. The time now is 01:19 AM.


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

Cheap Skiing
When it comes to cheap skiing, Holiday Hypermarket will speed you on your way. Searching the leading travel brands, Holiday Hypermarket offers you great value skiing.

Travel Counselors
Travel Counselors are an award winning Travel Agent. Why not have a personal Travel Counselor help with your travel plans.

Holidays to Thailand
The best cultures and backgrounds make Thailand an interesting and memorable country to visit. Book great value holidays to Thailand online at dealchecker.co.uk.

Holidays to St Lucia
Holidays to St Lucia will leave you smiling. The spectacular scenery and the warmth of the locals make holidays to St Lucia unforgettable.

Cheap Morocco Holidays
Cheap Morocco holidays may be the answer to your cheap holiday search. With sunshine throughout most of the year it can be great value if you avoid the peak season. Why not include a trip to the small tranquil town of Chefchaouen Tangier in your visit?

Travel Deals
Click here and read up on the travel deals available online.

Fuerteventura Holidays
Visit one of the closest Canary Islands to Africa! Book Fuerteventura holidays at On The Beach!


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