10 itrace::getpacketscount, Itrace::getpacketscount – Teledyne LeCroy FireInspector Automation Application Programming Interface User Manual

Page 48

Advertising
background image

44

FireInspector Automation User’s Manual

CATC

Version 1.0

2.4.10 ITrace::GetPacketsCount

Retrieves total number of packets in the trace.

Syntax

HRESULT GetPacketsCount (

[out, retval] long* number_of_packets );

Parameters

number_of_packets

points to long value where number of packets in the trace is

retrieved

Return values

Remarks

Example

WSH:

Set Analyzer = WScript.CreateObject("CATC.FwAnalyzer")

CurrentDir = Left(WScript.ScriptFullName,

InstrRev(WScript.ScriptFullName, "\"))

Set Trace = Analyzer.MakeRecording (CurrentDir &

"Input\test_ro.rec")

MsgBox Trace.GetPacketsCount & " packets recorded"

C++:

IFwTrace* fw_trace;

. . .

long number_of_packets;

long trigg_packet_num;

try

{

bstr_trace_name = fw_trace->GetName();

number_of_packets = fw_trace->GetPacketsCount();

trigg_packet_num = fw_trace->GetTriggerPacketNum();

}

catch ( _com_error& er)

{

if (er.Description().length() > 0)

::MessageBox( NULL, er.Description(), _T("FwAnalyzer

client"), MB_OK );

else

::MessageBox( NULL, er.ErrorMessage(),_T("FwAnalyzer

client"), MB_OK );

return 1;

}

TCHAR str_trace_name[256];

_tcscpy( str_trace_name, (TCHAR*)( bstr_trace_name) );

SysFreeString( bstr_trace_name );

Advertising