PDA

View Full Version : Open MapControl Argument Exception



RobAyers
10-06-2016, 08:57 AM
I have inherited an app from a developer that left the company and need to get it working. In theory it worked at some point in the past. It uses Mappoint 2011.
It has this code:

MyMapFileExists = System.IO.File.Exists(MyMapFilePath)
If MyMapFileExists Then
Try
MobileMapControl.OpenMap(MyMapFilePath)
Catch ex As Exception
MsgBox("Unable to open map file " & MyMapFilePath)
End Try
Else
MsgBox("Map file " & MyMapFilePath & " does not exist.")
End If

The OpenMap call generates an argument exception. The file exists, and I can navigate to and open the file with the desktop application. What could cause this?

Thanks I advance for any assistance.
Rob

RobAyers
10-06-2016, 09:31 AM
I have tried this line instead of the OpenMap call

MobileMapControl.NewMap(MapPoint.GeoMapRegion.geoM apNorthAmerica)

Got the same result.