Teledyne-lecroy SAS_SATA Automation API manual Bedienungsanleitung Seite 132

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 150
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 131
TeledyneLeCroy SASVScriptEngineObjectEvents
126 AutomationAPIforTeledyneLeCroySAS/SATAProtocolSuite
SASVScriptEngine Object Events
_IVScriptEngineEvents Interface
ToretrieveeventnotificationsfromtheTeledyneLeCroySAS/SATAProtocolSuite
applicationwhenaverificationscriptengineobjectisrunningthescript,youmust
implementthe_IVScriptEngineEventscallbackinterface. Sincethisinterfaceisadefault
sourceinterfacefortheSASVScriptEngineobject,thereisaverysimpleimplementation
fromlanguagessuchasVisualBasic,VBA,VBScript,andWSH.
Somescriptenginesimposerestrictionsonhandling eventsfromindirectautomation
objectsintypelessscriptlanguages(whenanautomationinterfacetotheobjectis
obtainedfromacallofsomemethod,ratherthanfromcreationfunction,suchas
CreateObject()inVBScript).TheSAS/SATAProtocolSuiteapplicationprovidesaspecial
COMclass,allowingreceivingandhandlingofnotificationsfromaVSEobjectevenin
scriptlanguagesnotsupportingeventhandlingfrom"indirect"objects.
Example
TheC++implementationusedintheexamplesbelowimplementsaneventsinkobjectby
derivingitfromIdispEventImpl,butnotspecifyingthetypeli braryasatemplate
argument.Instead,thetypelibraryanddefa ultsourceinterfacefortheobjectare
determinedusingAtlGetObjectSourceInterface().
ASINK_ENTRY()macroisusedforeacheventfromeachsourceinterfacethatistobe
handled:
Example
C++:
class CVSEngineSink : public
IDispEventImpl<IDC_SRCOBJ_VSE, CVSEngineSink >
{
public:
...
BEGIN_SINK_MAP(CVSEngineSink)
// Make sure the Event Handlers have __stdcall calling
convention.
SINK_ENTRY( IDC_SRCOBJ_VSE, 1, OnVScriptReportUpdated )
SINK_ENTRY( IDC_SRCOBJ_VSE, 2, OnVScriptFinished )
SINK_ENTRY( IDC_SRCOBJ_VSE, 3, OnNotifyClient )
END_SINK_MAP()
HRESULT __stdcall OnVScriptReportUpdated ( BSTR
newLine, int TAG );
HRESULT __stdcall OnVScriptFinished( BSTR script_name,
VS_RESULT result,
int TAG );
HRESULT __stdcall OnNotifyClient (int eventId, VARIANT
eventBody, int TAG);
Seitenansicht 131
1 2 ... 127 128 129 130 131 132 133 134 135 136 137 ... 149 150

Kommentare zu diesen Handbüchern

Keine Kommentare