
AutomationAPIforTeledyneLeCroySAS/SATAProtocolSuite 135
SASAnalyzerObjectEvents
TeledyneLeCroy
SASAnalyzer Object Events
_ISASAnalyzerEvents Dispinterface
ToretrievetheeventsfromaSASAnalyzerobject,youmustimplementthe
_ISASAnalyzerEventsinterface.Sincethisinterfaceisthedefaultsourceinterfaceforthe
SASAnalyzerobject,thereisaverysimpleimplementationfromlanguagessuchas
Visual Basic,VBA,VBScript,andWSH.
Somescriptenginesimposerestrictionsonhandling eventsfrom“indirect”automation
objectsintypelessscriptlanguages(whentheautomationinterfacetotheobjectis
obtainedfromacallofsomemethod,ratherthanfromacreationfunction,suchas
CreateObject()inVBScript).TheTeledyneLeCroySAS/SATAProtocolSuiteapplication
providesaspecialCOMclass,allowingreceivingandhandlingnotificationsfromtheVSE
objecteveninscriptlanguagesnotsupportingeventhandlingfrom"indirect"objects.
TheC++implementationusedintheexamplesbelowutilizesasinkobjectbyderivingit
fromIdis pEventImpl,butnotspecifyingthetypelibraryasatemplateargument.Instead,
thetypelibraryanddefaultsourceinterfacefortheobjectaredeterminedusing
AtlGetObjectSourceInterface().
ASINK_ENTRY()macroisusedforeacheventfromeachsourceinterfacethatistobe
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()
. . .
}
Komentáře k této Příručce