2 _ianalyzerevents::onstatusreport, Ianalyzerevents::onstatusreport – Teledyne LeCroy USB Analyzer Automation Manual User Manual

Page 118

Advertising
background image

Teledyne LeCroy Automation API Reference Manual for USBTracer, USB Advisor, and Voyager USB Protocol
Suite

118


HRESULT OnTraceCreated (

[in] IDispatch* trace );


Fired when trace is created.
This event is a result of an IAnalyzer::StartRecording or IAnalyzer::StopRecording method call.

Parameters

trace

Address of a pointer to the

UsbTrace

object primary interface

Return values

Remarks

Make sure the event handlers have

__stdcall calling convention.

Example


VBScript:

<OBJECT

ID = Analyzer
CLASSID = "clsid:0B179BB3-DC61-11d4-9B71-000102566088" >

</OBJECT>
<P ALIGN=LEFT ID=StatusText></P>

<SCRIPT LANGUAGE="VBScript">
<!--
Dim CurrentTrace
Sub Analyzer_OnTraceCreated(ByRef Trace)

On Error Resume Next
Set CurrentTrace = Trace
If Err.Number <> 0 Then

MsgBox Err.Number & ":" & Err.Description

End If
StatusText.innerText = "Trace '" & CurrentTrace.GetName & "' created"

End Sub
-->
</SCRIPT>


C++:

HRESULT __stdcall OnTraceCreated( IDispatch* trace )
{

IUsbTrace* usb_trace;
HRESULT hr;
hr = trace->QueryInterface( IID_IUsbTrace, (void**)&usb_trace );
if (FAILED(hr))
{

_com_error er(hr);
if (er.Description().length() > 0)
::MessageBox( NULL, er.Description(), _T("UsbAnalyzer client"), MB_OK );
else
::MessageBox( NULL, er.ErrorMessage(),_T("UsbAnalyzer client"), MB_OK );
return hr;
}


. . .
return hr;

}


9.1.2 _IAnalyzerEvents::OnStatusReport

Advertising