Community of VE/MapPoint Users and Developers
This is a discussion on MapPoint 2006 with ActiveX within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, i'm using c#.net, i made a wrapper for the ocx Visual Studio prompt: aximp <ocx-file> /source /keyfile:<key-file> the key ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| MapPoint 2006 with ActiveX i'm using c#.net, i made a wrapper for the ocx Visual Studio prompt: aximp <ocx-file> /source /keyfile:<key-file> the key doesn't matter, output are two files 1. AxMapPoint.dll 2. MapPoint.dll First i got the Problem that the ActiveX needed a parent using AxMapPoint; AxMappointControl mapPoint = new AxMappointControl(); form1.Controls.Add(mapPoint); mapPoint.NewMap(2); if you use something like this on a simple Form it's no problem. I made a class for using the Control and want to use it for calculation even without displaying. i got a form, simply said MyForm form1 = MyForm() then i give the ControlCollection of the Form.Panel to the Class an do following things (ControlCollection controls): AxMappointControl mapPoint = new AxMappointControl(); controls.Add(mapPoint); mapPoint.NewMap(2); ... form1.Show(); //not in the class, just to show that i try to display the form afterwards On the NewMap() Operation it bangs. Little bit of testing showed that if i make the Form Visible and do Operations like NewMap and Calculate everything works finy, but as soon as the form isn't visible no Operation works. It's not the problem that something crashs but i want to calculate distances of Routes even without displaying. Additional: First i used an Activator to call MapPoint.Application.EU.13 and did InvokeMember calls to use it, calculation and everything works fine, but i can't display it. 2 Ways of doing things for each part but they don't work together. I read about the object model but in c#.net there is just a Application interface, can't figure it out how this should work. I think that i use the object model with the Activator but little do i know ^^. (can't paste the whole code because of interfaces, factory and other stuff that i need for the project to make mappoint an optional part, but the problem is quite simple) I would like to use the OCX without displaying the Form but can't find a solution. Thanks for help. |
| |||
| Re: MapPoint 2006 with ActiveX
Oh, btw, if you need code of the Activator part etc. just post a request here. (maybe enriches the forum) It's just the problem that i need Late Binding for this project, but it works somehow, just the control struggles. And the helpfiles aren't very helpfull. Most parts are in VB and things you can't use in c#. |
| |||
|
Hi there, no, i won't write "I got the solution, thanks, bye". The problem was that the activeX wasn't completly initialized, in which way ever the show method of the form called the EndInit() Method of the ActiveX and made the usage afterwards possible. Solution: Just call it yourself. Form myForm = new Form(); AxMappointControl mapPoint = new AxMappointControl(); myForm.Controls.Add(mapPoint); mapPoint.EndInit(); // <- That's the way mapPoint.NewMap(MapPoint.GeoMapRegion.geoMapEurope ); myForm.Show(); Sry for my bad and irritating english, i'm german an not quite used to write or talk in english. Hope this helps some of you. |
| |||
| Re: MapPoint 2006 with ActiveX
Hi, I should work without the endInit(). Here I use an existing control. Maybe that is the reason: Code: public SnapToRoad(Control Owner, GeoMapRegion mapRegion)
{
owner = Owner;
mp = new AxMapPoint.AxMappointControl();
owner = Owner;
owner.Controls.Add(mp);
mp.NewMap(mapRegion);
map = mp.ActiveMap;
}
Code: ~SnapToRoad()
{
Dispose(false);
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposeManagedResources)
{
if (!disposed) {
if (disposeManagedResources) {
map.Saved = true;
owner.Controls.Remove(mp);
mp.Dispose();
mp = null;
map = null;
}
disposed = true;
}
}
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| activex, mappoint 2006 |
| ||||
| Posted By | For | Type | Date | |
| AxImp: Blogs, Photos, Videos and more on Technorati | This thread | Refback | 09-22-2007 07:50 AM | |
| Microsoft MapPoint 2006 - MP2K Magazine | This thread | Refback | 08-03-2007 10:32 PM | |
| Working With Excel and MapPoint - MP2K Magazine | This thread | Refback | 08-02-2007 02:23 AM | |
| MapPoint Help - MP2K Magazine | This thread | Refback | 08-01-2007 05:06 PM | |
| Building an Animated Map with Flash Demo Builder - MapPoint Articles - MP2K Magazine | This thread | Refback | 07-31-2007 12:45 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| VC++ doesn't find MapPoint 2006 ActiveX control | DrNobody | MapPoint 2006/2009 Discussion | 3 | 02-22-2007 09:41 AM |
| Mappoint 2006 ActiveX Questions | ben_dillon | MapPoint 2006/2009 Discussion | 3 | 01-31-2007 06:16 AM |
| FInd center location of ZipCode area using MP ActiveX (MP 2006) | Ekas | MapPoint 2006/2009 Discussion | 2 | 01-26-2007 09:46 AM |
| Difference between MapPoint 2006 and MapPoint 2006 Fleet | jlewis | MapPoint 2006/2009 Discussion | 1 | 11-21-2006 08:18 AM |
| mapPoint 2006 activex control slow down form closing | bule | MapPoint 2006/2009 Discussion | 1 | 09-26-2006 01:22 PM |
Ski Deals
Book first-rate ski holidays from the leading travel brands at exceptionally competitive prices. Check out the latest range of ski deal online at Holiday Hypermarket.
Home Based Travel Agent
Book your travel through a Home Based Travel agent. Travel Counsellors are a Queen's Award winning Travel Agent.
Holidays in Italy
Holidays in Italy boast some stunning countryside as well as a beautiful coastline. You can even visit an active volcano like Stromboli or Etna. Book at dealchecker.co.uk.
Holidays to Bahamas
Choose from a number of extraordinary holidays to the Bahamas at The Holiday Place. See pictures of these beautiful islands online.
Canaries
Find out all about the Canaries when you check out the ulookubook.com travel guides. Not only can you get a great holiday deal but you can find out useful information about potential holiday destinations.
Compare flight prices
Travel.co.uk makes it easy for you to compare flight prices from hundreds of UK based travel companies.
Cheap holidays in Cyprus
Stunning coastline! Beautiful beaches! Cheap holidays in Cyprus, available at On The Beach.