MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




MapPoint 2006 ActiveX with Form.Close

This is a discussion on MapPoint 2006 ActiveX with Form.Close within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, me again. Form form1 = new Form(); AxMappointControl mapPoint = new AxMappointControl(); form1.Controls.Add(mapPoint); mapPoint.EndInit(); mapPoint.NewMap(2); ... Calculate Route etc., ...


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  1 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 08-01-2007
Member
Yellow Belt
 
Join Date: Jul 2007
Posts: 45
Question MapPoint 2006 ActiveX with Form.Close

Hi, me again.

Form form1 = new Form();
AxMappointControl mapPoint = new AxMappointControl();
form1.Controls.Add(mapPoint);
mapPoint.EndInit();
mapPoint.NewMap(2);
...
Calculate Route etc., to put it simple - some Data is inserted
...
form1.Show();

Now i want that when the form is closed, that the Data still
stays with my ActiveX Control and i can make further
operations. Maybe after that display it on another form.

// After
form1.Close();
// and
form2.Controls.Add(mapPoint);
mapPoint.EndInit();
// i make a operation that returns the
// ActiveRoute
mapPoint.ActiveMap.ActiveRoute

InvalidComObjectException - A Com-Object, which was disconnected
from the basis of RCW, can't be used - in the AxMapPoint.cs:
return this.ocx.ActiveMap; //Exception at that part

I think it got something to do with the Close-Method.

Any suggestions or solutions to this problem?
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 08-04-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Re: MapPoint 2006 ActiveX with Form.Close

Hi,

As far as I know you cannot disconect an ActiveX and reconnect later. So I think the best solution is to geve it an Owner that stay alive during the lifetime of the program. For example your main form. Just pass it to the constructor of your class. You see example in my reply to your other post where I do something similar.
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 08-06-2007
Member
Yellow Belt
 
Join Date: Jul 2007
Posts: 45
Re: MapPoint 2006 ActiveX with Form.Close

Hi,

jep, didn't find a solution, i let my class have an
form which can be used before the other form is
closed. But got to do this step first by myself,
no secure way to make sure it won't be closed
before ^^
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 08-07-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Re: MapPoint 2006 ActiveX with Form.Close

Hi,

Take the main form. You are sure is stay alive during lifetime of the application
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 08-08-2007
Member
Yellow Belt
 
Join Date: Jul 2007
Posts: 45
Re: MapPoint 2006 ActiveX with Form.Close

Hmm, can i give the owner to the main form but the
map will keep on apearing on the DockPanel thats floating
around.
Don't think so ... surprise me ^^
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 08-09-2007
Junior Member
Yellow Belt
 
Join Date: Apr 2006
Posts: 18
Re: MapPoint 2006 ActiveX with Form.Close

You could save the map as a .ptm when you close the form - then when you need it again, load the .ptm back into a 'new' control - that's what I do...
__________________
John Lewis
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 08-09-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Re: MapPoint 2006 ActiveX with Form.Close

Hi,

Not the owner of the main form, but the main form itself !
you could also create a Control that stay alive during the time it should be and give it as Owner, and destroy it when no longer needed
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


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/mappoint-2006-activex-form-close-6120.html

Posted By For Type Date
Working With Excel and MapPoint - MP2K Magazine This thread Refback 08-02-2007 02:23 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
MapPoint 2006 with ActiveX jasanite MapPoint 2006/2009 Discussion 4 08-10-2007 10:05 AM
MapPoint 2006 ActiveX with new Form jasanite MapPoint 2006/2009 Discussion 1 08-01-2007 03:09 AM
Mappoint 2006 ActiveX Questions ben_dillon MapPoint 2006/2009 Discussion 3 01-31-2007 06:16 AM
Mappoint and Access with ActiveX On A Form jpateusa MapPoint 2006/2009 Discussion 4 01-30-2007 10:19 PM
mapPoint 2006 activex control slow down form closing bule MapPoint 2006/2009 Discussion 1 09-26-2006 01:22 PM


All times are GMT -5. The time now is 10:26 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

Flights from Birmingham
Here at Holiday Hypermarket you can book fantastic cheap flights from Birmingham Airport. Check out the great range of destinations.

Greece Weather
Check Turkey Weather before you travel. We provide information on Turkey including weather, flights and accommodation.

Holiday in Turkey
A Holiday in Turkey is great value when you book with dealchecker.co.uk. There is an abundance of things to see and do. Check out the well-preserved Greco-Roman ruins.

Cancun Holidays
Cancun holidays offer beautiful scenery, calm waters and plenty of shopping. Get a taste of the good life while on holiday in Cancun.

Tunisia
Tunisia enjoys excellent weather, golden beaches and a beautiful blue sea. Moving away from the beach you will find a country that has a rich and varied past. Discover the secrets of history yourself by exploring all the ruins.

Cheap Travel
Travel.co.uk is a travel comparison service which makes it easy to search and find your cheap travel options.

Holidays to Portugal
Want to take your family on a summer holiday? Visit On The Beach for more information on holidays to Portugal.


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