9 ianalyzer::getrecordingoptions, Parameters, Return values – Teledyne LeCroy Automation API for Teledyne LeCroy PETracer_PETrainer User Manual
Page 20: Remarks, Example, Ianalyzer::getrecordingoptions

Teledyne LeCroy
Automation API for PETracer/PETrainer
15
3.1.9 IAnalyzer::GetRecordingOptions
 
HRESULT GetRecordingOptions ( 
[out, retval] IDispatch** recording_options ) 
 
Retrieves the interface for access to the recording options.
Parameters 
 
recording_options
Address of a pointer to the
PERecOptions
object interface
Return values
 
 
Remarks
PERecOptions object is created via this method call, if the call was successful.
 
Example 
 
WSH: 
Set Analyzer = WScript.CreateObject( “CATC.PETracer” ) 
Set RecOptions = Analyzer.GetRecordingOptions( ) 
 
C++: 
 
HRESULT hr; 
IPEAnalyzer* poPEAnalyzer; 
 
// create PEAnalyzer object 
if ( FAILED( CoCreateInstance( 
 CLSID_PEAnalyzer, 
 NULL, CLSCTX_SERVER, 
 IID_IPEAnalyzer, 
 (LPVOID *)&poPEAnalyzer ) ) 
 
return;
 
// open trace file 
IDispatch* rec_opt; 
try 
{ 
rec_opt = poPEAnalyzer->GetRecordingOptions().Detach();
} 
catch ( _com_error& er) 
{ 
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 1;
}
 
 
// query for VTBL interface 
IPERecOptions* ib_rec_opt; 
hr = rec_opt->QueryInterface( IID_IPERecOptions, (LPVOID *)&ib_rec_opt ); 
rec_opt->Release(); 
 
if( FAILED(hr) ) 
return;
