Community of VE/MapPoint Users and Developers
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 ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| 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 |
| |||
| 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. |
![]() |
| Tags |
| mapinfo, vb6, work |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Plotting MapInfo data in MapPoint | cableghost | MapPoint 2006/2009 Discussion | 2 | 06-09-2005 04:08 PM |
| Unable to add Mapinfo files to MapPoint via Com Add-In | Acgmapping | MapPoint 2006/2009 Discussion | 2 | 01-27-2005 11:39 AM |
| ESRI and MapInfo Maps | Anonymous | MapPoint 2006/2009 Discussion | 1 | 04-28-2004 10:44 AM |
| Map-In-A-Box Puts MapPoint Maps Into MapInfo | Eric Frost | MP2K Magazine Articles | 0 | 10-02-2002 12:08 PM |
| MapPoint and MapInfo | JANOS | MapPoint 2006/2009 Discussion | 3 | 08-16-2002 06:39 PM |