Teledyne-lecroy SAS_SATA Automation API manual Instrukcja Użytkownika Strona 132

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 150
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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);
Przeglądanie stron 131
1 2 ... 127 128 129 130 131 132 133 134 135 136 137 ... 149 150

Komentarze do niniejszej Instrukcji

Brak uwag