Sub Class_Globals
Private fx As JFX
Private shl As Shell
Private caller As Object
Private callerTag As Int
End Sub
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize(callerArg As Object, callerTagArg As Int, eventName As String, _
procName As String, wrkingDir As String, args As List)
caller = callerArg
callerTag = callerTagArg
shl.Initialize(eventName, procName, args)
shl.WorkingDirectory = wrkingDir
End Sub
Private Sub shl_ProcessCompleted (Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
Dim errorStruct As procError_t
errorStruct.Initialize
errorStruct.CallerTag = callerTag
errorStruct.Success = Success
errorStruct.ExitCode = ExitCode
If Success And ExitCode = 0 Then
Log("Success")
Log(StdOut)
Else
Log("Error: " & StdErr)
End If
CallSub2(caller, "processError", errorStruct)
End Sub
Public Sub runProcess(time As Long)
shl.Run(time)
End Sub
Public Sub stopProcess
shl.KillProcess
End Sub