Teledyne LeCroy Sierra SAS_SATA Protocol Analyzer STX API Reference Manual User Manual
Page 141
Sierra SAS/SATA Protocol Suite, STX Software API Reference Manual
Using Trainer 141
Declare required objects in main class of your application
Declare smart pointers for SAS API Service and SAS General Service in the main class of your
application.
ISasAPISrvsPtr
m_SASAPI;
ISASGeneralServicePtr
m_pGeneralSrvPtr;
(Refer to TestTrainerAPI -> TestTrainerAPIDlg.h ->
CTestTrainerAPIDlg.)
Create Instances of the two objects just declared in the main class of your application
Create instances of the two declared objects in the InitInstance () function of the main class in
your application.
(Refer to TestTrainerAPI -> TestTrainerAPI.cpp -> InitInstance ().)
// Create instance of SAS API Service.
m_TrainerAPIdlg->m_SASAPI.CreateInstance
(
__uuidof
(SasAPISrvs));
// Create instance of SAS General Service.
LPDISPATCH GeneralServerDispatch = NULL;
m_TrainerAPIdlg -> m_SASAPI->GetSASGeneralServicePtr
(&GeneralServerDispatch);
GeneralServerDispatch -> QueryInterface (
__uuidof
(ISASGeneralService),
(
void
**)&m_TrainerAPIdlg->m_pGeneralSrvPtr);
m_pIGeneralSrvPtr.CreateInstance(__uuidof (SASGeneralService));