Teledyne-lecroy SAS_SATA Automation API manual Uživatelský manuál Strana 141

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 150
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 140
AutomationAPIforTeledyneLeCroySAS/SATAProtocolSuite 135
SASAnalyzerObjectEvents
TeledyneLeCroy
SASAnalyzer Object Events
_ISASAnalyzerEvents Dispinterface
ToretrievetheeventsfromaSASAnalyzerobject,youmustimplementthe
_ISASAnalyzerEventsinterface.Sincethisinterfaceisthedefaultsourceinterfaceforthe
SASAnalyzerobject,thereisaverysimpleimplementationfromlanguagessuchas
Visual Basic,VBA,VBScript,andWSH.
Somescriptenginesimposerestrictionsonhandling eventsfromindirectautomation
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()
. . .
}
Zobrazit stránku 140
1 2 ... 136 137 138 139 140 141 142 143 144 145 146 ... 149 150

Komentáře k této Příručce

Žádné komentáře