Cisco Cisco Computer Telephony Integration OS 8.5 Developer's Guide

Page of 546
 
Chapter 9      Agent Object
Methods
9-22
Cisco ICM Software CTI OS Developer’s Guide Release 6.0(0)
Each element in the returned arguments array consists of a key/value pair, in 
which the element key is the Unique Object Id of the skill group object and the 
value is a reference to a CILRefArg object instance that contains the actual 
reference to a CSkillGroup object. To retrieve a reference to a skill group object, 
you need to do something similar to what is shown in the following code example.
Arguments & arSkills = m_Agent->GetSkillGroups();
if(Arguments::IsValidReference(arSkills)){
     for(int nI = 1; nI <= arSkills.NumElements(); nI ++){
         string strUOID = arSkills.GetElementKey(nI);
         CilRefArg & pRefArg = (CilRefArg &) 
arSkills.GetValue(strUOID);
          if(Arg::IsValidReference(*pRefArg)){
               CSkillGroup * pSkill = pRefArg->GetValue();
               pRefArg->Release();
               
               cout << “Skill Object (“ << strUOID << “) ;
               cout << “ Skill Group Number: ” <<  ;
                             
pSkill->GetValueInt(CTIOS_SKILLGROUPNUMBER);
          }          
}
COM
In COM the GetSkillGroups method returns a pointer to a variant that 
encapsulates a Safearray where each element is a pointer to an ISkillGroup object.
To retrieve references to skill group objects you need to do something similar to 
what is shown in the following code example.
HRESULT hr = S_OK;
VARIANT varSkills; 
VariantInit(&varSkills)
hr  = m_Agent->GetSkillGroups(&varSkills);
if(SUCCEDED(hr)){       
     if(varSkills.vt  == (VT_ARRAY | VT_DISPATCH) ){
         long                  lNumElements = 0;
                           
          SafeArrayGetUBound(varSkills.parray,1,&lNumElements);
          
         for(long nI = 0; nI < lNumElements; nI ++){
             ISkillGroup * pSkill= NULL;