Sasanalyzer object events, Isasanalyzerevents dispinterface – Teledyne LeCroy SAS_SATA Automation API manual User Manual

Page 141

Advertising
background image

 

Automation API for Teledyne LeCroy SAS/SATA Protocol Suite

135

SASAnalyzer Object Events

Teledyne LeCroy

SASAnalyzer Object Events

_ISASAnalyzerEvents Dispinterface

To retrieve the events from a SASAnalyzer object, you must implement the 
_ISASAnalyzerEvents interface. Since this interface is the default source interface for the 
SASAnalyzer object, there is a very simple implementation from languages such as 
Visual Basic, VBA, VBScript, and WSH. 

Some script engines impose restrictions on handling events from “indirect” automation 
objects in typeless script languages (when the automation interface to the object is 
obtained from a call of some method, rather than from a creation function, such as 
CreateObject()
 in VBScript). The Teledyne LeCroy SAS/SATA Protocol Suite application 
provides a special COM class, allowing receiving and handling notifications from the VSE 
object even in script languages not supporting event handling from "indirect" objects. 

The C++ implementation used in the examples below utilizes a sink object by deriving it 
from IdispEventImpl, but not specifying the type library as a template argument. Instead, 
the type library and default source interface for the object are determined using 
AtlGetObjectSourceInterface()

SINK_ENTRY() macro is used for each event from each source interface that is to be 
handled:

class CAnalyzerSink : public IDispEventImpl<IDC_SRCOBJ,

CAnalyzerSink>

{
BEGIN_SINK_MAP(CAnalyzerSink)
// Make sure the Event Handlers have __stdcall calling

convention.

SINK_ENTRY(IDC_SRCOBJ, 1, OnTraceCreated)
SINK_ENTRY(IDC_SRCOBJ, 2, OnStatusReport)
END_SINK_MAP()
. . .
}

Advertising