locked
New to MapPoint and VB RRS feed

  • Question

  • SO I'm using VB 2008 Express and have the European MapPoint installed. I have enabled the COM object in VB and have put a new Map object on my form.

    In the form Load handler I have put

    AxMappointControl1.NewMap(2)

    And when I run the form a new map appears and all seems OK.

    I now want to link to some data in an excel file (3 columns, Lat,Long and name) and have the following Sub:

    Sub

     

    OpenDataSet()

     

    Dim objDataSets As MapPoint.DataSets

     

    Dim objDataSet As MapPoint.DataSet

     

    Dim zDataSource As String

    zDataSource =

    "C:\JMATS2.csv"

    objDataSets = AxMappointControl1.ActiveMap.DataSets

    objDataSet = objDataSets.ImportData(zDataSource, , , MapPoint.GeoDelimiter.geoDelimiterDefault, 1)

    objDataSet.Symbol = 20

     

     

    End Sub

    If I now run the map I get the following error on the importdata method which I can't seem to resolve. Please help

     


    System.Runtime.InteropServices.COMException was unhandled
      ErrorCode=-2146824233
      Message="No matching method defined for these fields."
      Source="MapPoint.Application.EU.16"
      StackTrace:
           at MapPoint.DataSets.ImportData(String DataSourceMoniker, Object ArrayOfFields, GeoCountry Country, GeoDelimiter Delimiter, Int32 ImportFlags)
           at WindowsApplication1.Form1.OpenDataSet() in C:\Users\JMATS\Documents\Visual Studio 2008\Projects\MapPoint\MapPoint\Form1.vb:line 19
           at WindowsApplication1.Form1.Form1_Load(Object sender, EventArgs e) in C:\Users\JMATS\Documents\Visual Studio 2008\Projects\MapPoint\MapPoint\Form1.vb:line 6
           at System.EventHandler.Invoke(Object sender, EventArgs e)
           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.RunMessageLoopInner(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
           at System.Windows.Forms.Application.Run(ApplicationContext context)
           at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
           at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
           at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
           at WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
           at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
           at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           at System.Threading.ThreadHelper.ThreadStart()
      InnerException:



    • Moved by Michael Sun [MSFT]Microsoft employee Wednesday, September 30, 2009 7:11 AM off topic for application compatibility for windows (From:Application Compatibility for Windows Development)
    Tuesday, September 29, 2009 4:12 PM

Answers

All replies

  • it does not look like your program works at all. this forum is for porting existing applications for other version of Windows or submit it for Microsoft Logo Test. I suggest you go to the "where is the forum for" forum to find a forum for mappoint development.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful.
    Visual C++ MVP
    Tuesday, September 29, 2009 6:19 PM
  • For MapPoint help: http://social.microsoft.com/Forums/is/streetsandtrips/threads

    Thanks!


    Ed Price (a.k.a User Ed), SQL Server Customer Program Manager (Blog, Twitter, Wiki)

    Monday, November 26, 2012 5:42 AM