Thank you fellow MapInfo Listers for the responses!
 
Lars V. Nielsen (GisPro) wondered if Full MIPro = mapinfow.exe, runtime
versions = mapinfor.exe would do the trick, it didn't.
 
Then, suggested by Peter Horsb�ll M�ller(GisPro)
to look at the OLE object definition using "MapInfo.Runtime" instead of
"MapInfo.Application" was indeed the right one. I also found this statement
in the MapBasic Helpfile. 
 
Alejandro( <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]) from Argentina
gave a verry nice VB-function to check which MI was installed:

Public Sub MI_InitializeMapInfoConnection() 

Dim lb_UnableToCreateObj As Integer
    
    lb_UnableToCreateObj = False
    
    On Error GoTo MI_InitializeMapInfoConnection_Error_MapInfo_Pro
    Set MI = CreateObject("MapInfo.Application")
    On Error GoTo 0

 
    If lb_UnableToCreateObj Then
        On Error GoTo MI_InitializeMapInfoConnection_Error_MapInfo_Run
        Set MI = CreateObject("MapInfo.Runtime")
        On Error GoTo 0
    End If
 
    Exit Sub
 
MI_InitializeMapInfoConnection_Error_MapInfo_Pro:
    'If we can't create the object using MapInfo Pro, we try to use the
runtime
    lb_UnableToCreateObj = True
    Resume Next
 
MI_InitializeMapInfoConnection_Error_MapInfo_Run:
    'If the attempt to create the runtime object also fails we are done.
    MsgBox "Impossible to create MapInfo Object"
    End
    
End Sub 
 
What I programmed myself was:
 
Public Enum MI_APP_TYPE
    PROFESSIONAL = 1
    RUNTIME = 2
End Enum
 
Public Function Initiate(Visible As Boolean, iAppType As MI_APP_TYPE) As
Boolean
        'Start MapInfo OLE container
        '<EhHeader>
        On Error GoTo Initiate_Err
        '</EhHeader>
100     Active = False
102     Select Case iAppType
 
            Case 1 'PROFESSIONAL
104             Set Instance = CreateObject("MapInfo.application")
 
106         Case 2 'RUNTIME
108             Set Instance = CreateObject("MapInfo.runtime")
        End Select
 
110     If Visible Then
        'Load MapInfo with it's own shell visible
112         Instance.Application.Visible = True
        End If
 
122     Instance.setcallback CallBack
124     Set CallBack.Parent = Me
126     Active = True
        '<EhFooter>
        Exit Function
Initiate_Err:
 
        Err.Raise vbObjectError + 100, "clsMapInfo.MapInfo.Initiate",
"clsMapInfo.MapInfo.Initiate " & "at line" & Erl & " (component)"
        '</EhFooter>
End Function 
 
Kind regards,
 
Milo van der Linden 
AVD-ICT GIS Consultant 


*       Hoogbloklandseweg 24
*       4205 NE  Gorinchem

Tel. +31 183 50 81 50 
Fax. +31 183 50 81 60 
Mob. +31 629 54 06 96 

 

Reply via email to