
A1.6 Adding a user-friendly interface with Visual Basic 19
Private Sub Generate_Click()
Dim Res As Integer
Res = FOxRun(giMainIP, "OnGenerate")
If (Res > 0) Then
Draw.Enabled = True
Variance.Enabled = True
End If
End Sub
Private Sub Variance_Click()
Dim Res As Integer
Res = FOxRun(giMainIP, "OnVariance")
End Sub
.......................................................................................
• FOxGiveWinStart is again required to start GiveWin and establish the automa-
tion link.
• The GetRanAppSettings is added to Ox. This time it is a functionwhich resides
in the Basic code. The AddressOf operator returns the function address.
• OxMainCmd is used to call Ox with the whole command line in a string. We
assume that RanApp.ox is in the current directory.
• Pressing a button calls the corresponding Ox function.
The Basic function FnGetRanAppSettings is called as GetRanAppSettings
from Ox:
...............................................ox/dev/windows/vb/RanAppFn.bas
Attribute VB_Name = "RanAppFn"
Public Sub FnGetRanAppSettings(ByVal rtn As Long, _
ByVal pv As Long, ByVal cArg As Integer)
Call OxLibCheckType(OX_ARRAY, pv, 0, 2)
Dim cT As Long
Dim cN As Long
Dim cLag As Long
Dim Res As Integer
Dim dlg As New RanDimDlg
Res = OxValGetInt(OxValGetArrayVal( _
OxValGetVal(pv, 0), 0), cT)
Res = OxValGetInt(OxValGetArrayVal( _
OxValGetVal(pv, 1), 0), cN)
Res = OxValGetInt(OxValGetArrayVal( _
OxValGetVal(pv, 2), 0), cLag)
dlg.mcT = cT
dlg.mcN = cN
dlg.mcLag = cLag
dlg.Show vbModal
If (dlg.mIsOK) Then
Kommentare zu diesen Handbüchern