EsbCancelProcess

まだ完了していない非同期プロセスを取り消します。

構文

            EsbCancelProcess
             (
            hCtx
            )
ByVal 
            hCtx
             As Long
         
パラメータ説明

hCtx

VB APIコンテキスト・ハンドル。

備考

戻り値

なし。

アクセス

この関数を使用するのに、特別な権限は必要ありません。

         Declare Function EsbCancelProcess Lib "ESBAPIN" (ByVal hCtx As Long) As Long

Sub ESB_CancelProcess ()
   Dim sts As Long
   Dim CalcScript As String 
   Dim Calculate As Integer
   Dim ProcState As ESB_PROCSTATE_T
   Dim Items As Integer   CalcScript = "CALC ALL;"
   Calculate = ESB_YES   '***********
   ' Begin Calc
   '***********
   sts = EsbBeginCalc (hCtx, Calculate)
   '***********************
   ' Send Calc script
   ' It is possible to send
   ' more than one string 
   '***********************
   sts = EsbSendString (hCtx, CalcScript)   '*********
   ' End Calc 
   '*********
   sts = EsbEndCalc (hCtx)   '************************************
   ' Check process state and cancel it if
   ' it takes too long 
   '************************************
   sts = EsbGetProcessState (hCtx, ProcState)
   Items = 1
    Do While ProcState.State = ESB_STATE_INPROGRESS 
     Items = Items + 1
     If Items = 1000 Then      '***************
      ' Cancel process
      '*************** 
      sts = EsbCancelProcess (hCtx) 
     End If 
   Exit Do
      sts = EsbGetProcessState (hCtx, ProcState)
   Loop 
End Sub
      

関連トピック