2 _ivscriptengineevents::onvscriptfinished, Ivscriptengineevents::onvscriptfinished – Teledyne LeCroy USB Analyzer Automation Manual User Manual
Page 97

Teledyne LeCroy Automation API Reference Manual for USBTracer, USB Advisor, and Voyager USB Protocol
Suite
97
6.1.2 _IVScriptEngineEvents::OnVScriptFinished
[id(2)] HRESULT OnVScriptFinished ( [in] BSTR script_name,
[in] VS_RESULT result, [in] int TAG );
Fires when the verification script stops running.
Parameters
script_name Name of the verification script
result
Result of the "verification"
(See
IUsbVerificationScript::RunVerificationScript
TAG
VSE object's tag
Return values
Remarks
Make sure that C++ event handlers have
__stdcall
calling convention.
Example
C++:
HRESULT __stdcall CComplTestSink::OnVScriptFinished
( BSTR script_name, VS_RESULT result, int TAG )
{
USES_CONVERSION;
TCHAR tmp[220];
sprintf( tmp, "Script completed, name : %s, result = %d, TAG = %d",
W2A(script_name), result, TAG );
. . .
return S_OK;
}
VBA (MS Excel):
Public WithEvents VSEEvents As VScriptEngine
. . .
Private Sub VSEEvents_OnVScriptFinished( ByVal script_name As String,
ByVal result As UWBAutomationLib.VS_RESULT, ByVal Tag As Long )
Dim ResString As String
ResString = "Script name : " & script_name & ", result = " & CStr(result) &
", TAG = " & CStr(Tag)
ThisWorkbook.Sheets("Sheet1").Cells(7, 2) = ResString
End Sub