3 itrace::save, Itrace::save – Teledyne LeCroy FireInspector Automation Application Programming Interface User Manual
Page 33

29
FireInspector Automation User’s Manual
CATC
Version 1.0
2.4.3
ITrace::Save
Saves trace into file, allows to save a range of packets.
Syntax
HRESULT Save (
[in] BSTR file_name,
[in, defaultvalue(-1)] long packet_from,
[in, defaultvalue(-1)] long packet_to );
Parameters
•
file_name
–
string providing the full pathname to file where trace is saved
•
packet_from
–
beginning packet number when you are saving a range of packets,
value -1 means that the first packet of saved trace would be the first packet of this trace
•
packet_to
–
ending packet number when you are saving a range of packets, value -1
means that the last packet of saved trace would be the last packet of this trace
Return values
•
ANALYZERCOMERROR_UNABLESAVE
–
unable to save trace file
Remarks
Use this method if you want to save recorded or opened trace into the file. If the display
options applied to this trace (see ITrace::ApplyDisplayOptions
and IAna-
lyzer::LoadDisplayOptions on page 20) then hidden packets would not be saved.
If packet range is specified and it is invalid (for example
packet_to
is more then last
packet number in the trace, or
packet_from
is less then first packet number in the
trace, or
packet_from
is more than
packet_to
) then packet range will be adjusted
automatically.
Example
WSH:
Set Analyzer = WScript.CreateObject("CATC.FwAnalyzer")
CurrentDir = Left(WScript.ScriptFullName,
InstrRev(WScript.ScriptFullName, "\"))
Set Trace = Analyzer.MakeRecording (CurrentDir &
"Input\test_ro.rec")
Trace.ApplyDisplayOptions CurrentDir &
"Input\test_do.opt"
Trace.Save CurrentDir &
"Output\saved_file.fdb"
C++:
IFwTrace* fw_trace;
TCHAR file_name[_MAX_PATH];
LONG packet_from;
LONG packet_to;
. . .
try
{