Specifications
OLE reference
140
Glink: API reference manual Gallagher & Robertson
and the list appears. Once you have selected "Glink", type a dot and a list of
interfaces will be displayed:
Dim Gl as Glink.
Select "Auto".
Dim Gl as Glink.Auto
If you want the Glink.Auto object created automatically as soon as it's used, then
use:
Dim Gl as new Glink.Auto
If you are going to use the Glink's Automation events, then you must use the
WithEvents keyword. However, when using the WithEvents keyword you
cannot use the New keyword and will need to create the object at runtime:
Dim WithEvents Gl as Glink.Auto
Private Sub Form_Load()
Set Gl = New Glink.Auto
'or Set Gl = CreateObject("Glink.Auto")
'or Set Gl = GetObject("", "Glink.Auto")
End Sub
Once the object is created you can use any method or property directly.
Text1.Text = Gl.Screen.ScreenText
Lists of the relevant properties and methods will appear as soon as you type the
dot (or bracket).
If Gl.Screen.FormsMode then
If Gl.Screen.Field(1).Fixed = false then
Text1.Text = Gl.Screen.Field(1).FieldText
End If
End If
If the WithEvents keyword was used when declaring your object variable, then
your Glink.Auto object name will be displayed in the Object list. In the above
example it would be called "Gl". Select it and the Procedures list will be filled
with the available Glink.Auto Automation events, OnConnect, OnDisconnect,
OnTurn, etc. Selecting one of the Events will generate the function which will be
called when Glink signals that particular event.
Function Gl_OnTurn()
Text1.Text = Gl.Screen.ScreenText