PDA

View Full Version : Mappoint 2011 and Visual Studio 2010



Noelw
08-09-2011, 03:15 PM
Hi,

I'm new to developing with MapPoint and have fallen at the first hurdle!!
I have installed MapPoint 2011, VS 2010 and am running Win7.
To try to see how thng to load the formings worked I have taken a very simplistic (or so I thought) approach.
I have added the MapPoint control to my project (as per ms kb articles) and have tried to use the sample code but I can not load the control.
Here is the entire code I use on my form;
Public Class frmConMap
Friend conMap As MapPoint.Map

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Me.Close()
End Sub
Private Sub frmConMap_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
AxMappointControl1.NewMap(MapPoint.GeoMapRegion.ge oMapEurope)
conMap = AxMappointControl1
End Sub

End Class
Here is the error that I get when trying to load the form;
System.Runtime.InteropServices.COMException was unhandled
ErrorCode=-2147418113
Message=This method or property is not implemented.
Source=MapPoint.Control.17
StackTrace:
at MapPoint.IMappointCtrl.NewMap(Object Template)
at AxMapPoint.AxMappointControl.NewMap(Object template)
at JobPlus.frmConMap.frmConMap_Load(Object sender, EventArgs e) in F:\Visual Studio Projects\JobPlus\JobPlus\frmConMap.vb:line 11
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at JobPlus.frmConAddressList.btnMap_Click(Object sender, EventArgs e) in F:\Visual Studio Projects\JobPlus\JobPlus\frmConAddressList.vb:line 346
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at JobPlus.frmMenu.btnAddDelPoints_Click(Object sender, EventArgs e) in F:\Visual Studio Projects\JobPlus\JobPlus\frmMenu.vb:line 94
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.RunDialog(Form form)
at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at JobPlus.SubMain.Main() in F:\Visual Studio Projects\JobPlus\JobPlus\SubMain.vb:line 24
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
I have searched the internet and have tried other methods of loading the control but they always result in the same error.
I have ran bcdedit.exe at the command line to totally turn off DEP so I believe that I have eliminated that as the cause.
TBH I'm running out of places to look to try to resolve this and am hoping that the good people on here can point me in the right direction.
Thanks in advance,
Noel.

marcick
08-10-2011, 06:52 AM
Do you have a 64 bit OS ? I don't know about MP2011, but for 2010 the control doesn't work on Win7 64 bit, you have to compile it as 32 bit to work.
Hope this is useful
marco

Noelw
08-10-2011, 09:27 AM
hi marco,

unfortunately the os is plain old 32 bit.

thanks anyway.

noel

Noelw
08-17-2011, 02:39 AM
I've still not managed to crack this one but I have found that the problem is NOT a combination VS 2010 and MapPoint 2011 and Win 7 as I have installed successfully run the project on my Win7 desktop PC.

This further confirms my theory the DEP is not to blame as it is running on the desktop PC, the only real difference I can see is that my desktop pc is running VS 2010 ver 10.0.30319.1 RTMRel
and my laptop is running ver 10.0.40219.1 SP1Rel

I know others are experiencing similar problems so it would be interesting to know what version of VS 2010 they are running.

Regards,
Noel