2 _ivscriptengineevents::onvscriptfinished, Ivscriptengineevents::onvscriptfinished – Teledyne LeCroy UWBTracer Automation Manual User Manual
Page 73

LeCroy
UWBTracer Automation API Reference Manual
Manual Version 3.02
69
6.1.2 _IVScriptEngineEvents::OnVScriptFinished
[id(2)] HRESULT OnVScriptFinished ( [in] BSTR script_name,
[in] VS_RESULT result, [in] int TAG );
Fired when the verification script stops running.
Parameters
script_name
Name of the verification script
result
Result of the "verification"
(See
IUwbVerificationScript::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