Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 9 of 9

Work with mapinfo by VB6, help me!!!

This is a discussion on Work with mapinfo by VB6, help me!!! within the Other Mapping Platforms forums, part of the Map Forums category; I want import a map of mapinfo to VB6, i don't make it, every body help me. func "callback" do ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    Work with mapinfo by VB6, help me!!!

    I want import a map of mapinfo to VB6, i don't make it, every body help me. func "callback" do not operate in VB6. thank!!!

  2. #2
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4
    Try posting in the MapInfo forum: http://www.mapinfo-l.com

    Thanks,
    Eric
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  3. #3
    marmi is offline Junior Member White Belt
    Join Date
    Feb 2007
    Posts
    2

    Re: Work with mapinfo by VB6, help me!!!

    hi
    this is a way to load a mapinfo table within a vb6 form.
    create a vb6 project.

    on the form place a picturebox, a commandbutton and a commondialog

    // this code goes into module level//
    Public itsamap As Boolean
    Public mapWinID As Long
    Public mapinfo As Object

    public Sub OpenATable()
    Dim file_name As String
    Dim tabName As String
    On Error GoTo userCancelled
    form1.CommonDialog1.Filter = "MapInfo Tables (*.tab)|*.tab"
    form1.CommonDialog1.FilterIndex = 1
    form1.CommonDialog1.ShowOpen
    file_name = form1.CommonDialog1.FileName
    tabName = mapinfo.Eval("PathToTableName$( """ & file_name & """ )")
    mapinfo.Do "Open Table """ & file_name & """ as " & tabName
    mapinfo.Do "Set Table " & tabName & " ReadOnly"
    If mapinfo.Eval("TableInfo(" & tabName & "," & 5 & ")") = "F" Then
    MsgBox "Cannot open table!"
    mapinfo.Do "Close Table " & tabName
    Exit Sub
    End If
    If itsamap Then
    mapinfo.Do "Add Map Layer " & tabName
    Else
    mapinfo.Do "Set Next Document Parent " & form1.picture1.hWnd & " Style 1"
    mapinfo.Do "Map From " & tabName
    mapWinID = CLng(mapinfo.Eval("FrontWindow()"))
    itsamap = True
    End If
    Exit Sub
    userCancelled:
    Exit Sub
    End Sub
    -----------------------------------------------------------------------
    // this code goes into form level//
    Private Sub Form_Load()
    Set mapinfo = CreateObject("MapInfo.Application")
    mapinfo.Do "Set Application Window " & form1.hWnd
    End Sub

    Private Sub Command1_Click()
    Call OpenATable
    End Sub

  4. #4
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    Re: Work with mapinfo by VB6, help me!!!

    Cool thanks for posting the code.

    That will just post the image, right?

    Next time, please surround your code with the code tags, it is the pound symbol. That way it will be properly posted into the forum with indentation. Try it and let me know what you think, you should be able to edit your earlier post.

    Eric

  5. #5
    marmi is offline Junior Member White Belt
    Join Date
    Feb 2007
    Posts
    2

    Re: Work with mapinfo by VB6, help me!!!

    dear eric
    actually, the code i submitted for implementing a map within vb does not only display the map as image.
    there are some useful constants we can use to execute commands as if we are in mapinfo.
    here are some if you want to try.

    put the following code in a module:

    Global Const M_TOOLS_SELECTOR = 1701
    Global Const M_TOOLS_SEARCH_RECT = 1722
    Global Const M_TOOLS_SEARCH_RADIUS = 1703
    Global Const M_TOOLS_SEARCH_BOUNDARY = 1704
    Global Const M_TOOLS_EXPAND = 1705
    Global Const M_TOOLS_SHRINK = 1706
    Global Const M_TOOLS_RECENTER = 1702
    Global Const M_TOOLS_PNT_QUERY = 1707
    Global Const M_TOOLS_LABELER = 1708
    Global Const M_TOOLS_DRAGWINDOW = 1734
    Global Const M_TOOLS_RULER = 1710
    Global Const M_TOOLS_INFO = 1790

    call them by using the following:
    ex:

    mapinfo.RunMenuCommand 1708

    this will allow you for instance to display the label.

    i can e.mail you the entire constants list if you want.
    Last edited by marmi; 02-20-2007 at 10:03 AM.

  6. #6
    ltacie is offline Junior Member White Belt
    Join Date
    Jul 2008
    Posts
    1

    Work with mapinfo by VB6, help me!!!

    How to add a symbol, edit a map (tab file) in vb6 code?
    Thanks!

  7. #7
    Adi09 is offline Junior Member White Belt
    Join Date
    Aug 2008
    Posts
    1

    Re: Work with mapinfo by VB6, help me!!!

    hi...
    can any one give me source code how to open file workspace mapinfo at vb?? i change *.tab with *.wor and not working... help.... please..

  8. #8
    goc
    goc is offline Junior Member White Belt
    Join Date
    May 2011
    Posts
    1

    Re: Work with mapinfo by VB6, help me!!!

    Quote Originally Posted by marmi View Post
    dear eric
    actually, the code i submitted for implementing a map within vb does not only display the map as image.
    there are some useful constants we can use to execute commands as if we are in mapinfo.
    here are some if you want to try.

    put the following code in a module:

    Global Const M_TOOLS_SELECTOR = 1701
    Global Const M_TOOLS_SEARCH_RECT = 1722
    Global Const M_TOOLS_SEARCH_RADIUS = 1703
    Global Const M_TOOLS_SEARCH_BOUNDARY = 1704
    Global Const M_TOOLS_EXPAND = 1705
    Global Const M_TOOLS_SHRINK = 1706
    Global Const M_TOOLS_RECENTER = 1702
    Global Const M_TOOLS_PNT_QUERY = 1707
    Global Const M_TOOLS_LABELER = 1708
    Global Const M_TOOLS_DRAGWINDOW = 1734
    Global Const M_TOOLS_RULER = 1710
    Global Const M_TOOLS_INFO = 1790

    call them by using the following:
    ex:

    mapinfo.RunMenuCommand 1708

    this will allow you for instance to display the label.

    i can e.mail you the entire constants list if you want.

    Hi, I know Its little too late but if are able to send me some examples for conecting VB and MI would be great.

    I am 20 f and its 4 my school project tnx

  9. #9
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4

    Re: Work with mapinfo by VB6, help me!!!

    Do you have access to the MapBasic manuals? There must be some examples.

    Eric
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Plotting MapInfo data in MapPoint
    By cableghost in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 06-09-2005, 04:08 PM
  2. Unable to add Mapinfo files to MapPoint via Com Add-In
    By Acgmapping in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 01-27-2005, 11:39 AM
  3. ESRI and MapInfo Maps
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 04-28-2004, 10:44 AM
  4. Map-In-A-Box Puts MapPoint Maps Into MapInfo
    By Eric Frost in forum MP2K Magazine Articles
    Replies: 0
    Last Post: 10-02-2002, 12:08 PM
  5. MapPoint and MapInfo
    By JANOS in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 08-16-2002, 06:39 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25