beautypg.com

1 _ianalyzerevents::ontracecreated, Parameters, Remarks – Teledyne LeCroy Automation API for Teledyne LeCroy PETracer_PETrainer User Manual

Page 140: Example, Dim currenttrace, Ianalyzerevents::ontracecreated

background image

Teledyne LeCroy

Automation API for PETracer/PETrainer

135

11.1.1 _IAnalyzerEvents::OnTraceCreated


HRESULT OnTraceCreated (

[in] IDispatch* trace )

Fired when a trace is created. This event is a result of IAnalyzer::StartRecording and IAnalyzer::StopRecording
method calls (see Pages 10, 12).

Parameters

trace

Interface pointer to the

PETrace

object

Remarks

Make sure the event handlers have __stdcall calling convention.

Example


VBScript:

ID = Analyzer
CLASSID = "clsid: 297CD804-08F5-4A4F-B3BA-779B2654B27C "

>





C++:

HRESULT __stdcall OnTraceCreated( IDispatch* trace )
{

IPETrace* pe_trace;
HRESULT hr;
hr = trace->QueryInterface( IID_IPETrace, (void**)&pe_trace );

if (FAILED(hr))
{

_com_error er(hr);
if (er.Description().length() > 0)

::MessageBox( NULL, er.Description(), _T("PETracer client"), MB_OK );

else

::MessageBox( NULL, er.ErrorMessage(),_T("PETracer client"), MB_OK );

return hr;

}

. . .

return hr;

}