I'm attempting to do this for the first time (I'm a Delphi programmer and not
experienced with Access or VB). I've put a sub-form in a main form and attached the
following code as a class module to the on load event of the main form. This works up
to a point - the workspace appeasr briefly within the sub-form but then disappears. If
I add to the code "Mi.Application.Visible = True", the workspace stays visisble in the
sub-form, but I then have a MapInfo application wondow open, which I don't want. Any
help appreciated.
Private Sub Form_Load()
Dim Mi As Object
Dim winIDMap As String
Dim frm As Form
Dim MapHwnd As Long
Dim wor As String
Set Mi = CreateObject("mapInfo.Application")
Set frm = Forms!frmTestMI!frmTestMISub.Form
wor = "M:\APPS\WORKS\gen_purp.WOR"
Mi.Do "Set application Window " & frm.Hwnd
Mi.Do "Set Next Document parent " & frm.Hwnd & " Style 1"
Mi.Do "Run Application """ & wor & """"
winIDMap = Val(Mi.Eval("WindowInfo(1,13)"))
Mi.Do ("Set Window " & winIDMap & " Front")
End Sub
***************************************************
Alan Hale
Area Ecologist, West Area
Countryside Council for Wales
Plas Gogerddan
Aberystwyth SY23 3EE
Tel.: 01970 821100
Email: [EMAIL PROTECTED]
***************************************************
_______________________________________________________________________
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, send e-mail to [EMAIL PROTECTED] and
put "unsubscribe MapInfo-L" in the message body.