Teledyne-lecroy SAS_SATA Automation API manual Manual de usuario Pagina 132

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 150
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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);
Vista de pagina 131
1 2 ... 127 128 129 130 131 132 133 134 135 136 137 ... 149 150

Comentarios a estos manuales

Sin comentarios