beautypg.com

Sasvscriptengine, Objec – Teledyne LeCroy SAS_SATA Tracer_Trainer Automation API Manual User Manual

Page 70

background image

LeCroy Corporation

Automation API for SAS/SATATracer/Trainer

Manual Version 1.11

70

C++:

ISASTrace* sas_trace;


. . .

ISASAnalyzerErrors* analyser_errors;
try
{

analyser_errors = sas_trace->AnalyzerErrors(error_type).Detach();

}
catch (_com_error& er)
{

if (er.Description().length() > 0)
::MessageBox( NULL, er.Description(), _T("SASTracer client"), MB_OK );
else
::MessageBox( NULL, er.ErrorMessage(),_T("SASTracer client"), MB_OK );
return 1;

}

TCHAR all_errors[2048];
_stprintf( all_errors, _T("Errors: ") );

try
{

long errors_count = analyser_errors->GetCount();
long analyzer_error;
if ( !errors_count )
{

_tcscat( all_errors, _T("none") );

}
for ( long i=0; i{

analyzer_error = analyser_errors->GetItem(i);
TCHAR cur_error[32];
_stprintf( cur_error, _T(" %ld"), analyzer_error );
_tcscat( all_errors, cur_error );

}
if ( i>2048/32 )

_tcscat( all_errors, _T(" ...") );

}
catch (_com_error& er)
{

if (er.Description().length() > 0)
::MessageBox( NULL, er.Description(), _T("SASTracer client"), MB_OK );
else
::MessageBox( NULL, er.ErrorMessage(),_T("SASTracer client"), MB_OK );
return 1;

}

analyser_errors->Release();

::SetWindowText( m_hwndStatus, all_errors );