Community of VE/MapPoint Users and Developers
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., ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| 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? |
| |||
| 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.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| 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 ^^ |
| |||
| Re: MapPoint 2006 ActiveX with Form.Close
Hi, Take the main form. You are sure is stay alive during lifetime of the application
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| 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 |
| |||
| 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
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| ||||
| 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 | |
| |
| ||||
| 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 |
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.