View Single Post

  #2 (permalink)  
Old 08-23-2007
jasanite jasanite is offline
Member
Yellow Belt
 
Join Date: Jul 2007
Posts: 45
Re: VS2008 b2 + Mappoint 2006

Hi, a wrong answer is better than no answer ... right?
blind shot ... so just use it as much as its worth

I had an similar problem when i tried to use the ctrl
without visualising it. So i guess Vs2008 has a problem
to add it correct to the form, ergo the ocx isn't fully
initialized. (I have 2005)

My code:
Code:
AxMappointControl mpCtrl = new AxMappointControl();
Form.Control.Add(mpCtrl);
mpCtrl.EndInit();
mpCtrl.NewMap(MapPoint.GeoMapRegion.geoMapEurope);
So maybe your Control isn't really added to the form,
or the initialization isn't finished. I think it is the
second one therefor you will need the EndInit.
When you debuged the error, you got into the
Ax and (ocx == null) ... throw ... , just from my
experience.

You can also use your own instance like in the code
above. AFAIK
Reply With Quote