Teledyne LeCroy SAS_SATA Tracer_Trainer Automation API Manual User Manual

Page 83

Advertising
background image

LeCroy Corporation

Automation API for SAS/SATATracer/Trainer

Manual Version 1.11

83


Then, after you have established the connection with the server, you need to advise your
implementation of the event interface:

IVScriptEngine vscript_engine = NULL;

try
{

vscript_engine = vscript ->GetVScriptEngine( "Test_1" );

}
catch (_com_error& er )
{

SetStatusError( er );

}

if ( vscript_engine == NULL )
{

vscript = NULL;
return E_FAIL;

}

CVSEngineSink vse_sink;
HRESULT hr = vse_sink . Advise( vscript_engine ); // “Subscribe” for receiving events.

...

VS_RESULT res = SCRIPT_NOT_FOUND;
try
{

res = (VS_RESULT)vscript_engine ->RunVScript();

}
catch (_com_error& er)
{

SetStatusError( er );

}

// Tear connection with the test case.
vse_sink.Unadvise( vscript_engine );

...





























Advertising