Cisco Cisco Computer Telephony Integration OS 8.5 Developer's Guide

Page of 668
 
Chapter 9      Agent Object
Methods
9-24
CTI OS Developer’s Guide for Cisco ICM/IPCC Enterprise & Hosted Editions Release 7.1(1) 
}
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;
             hr=SafeArrayGetElement(varSkills.parray,&nI,&pSkill);
             if(SUCCEDED(hr)){
                  int nSkillGrpNumber = 0;
                   VARIANT vPropKey;
                   VariantInit(&vPropKey);
                   vPropKey.vt = VT_BSTR;
                   vPropKey.bstr =  OLESTR(“SkillGroupNumber”);
                   pSkill->GetValueInt(vPropKey,&nSkillGrpNumber);
                  pSkill->Release();
                  VariantClear(&vPropKey);
             }
         }          
     }
}
VB
In VB the GetSkillGroups method returns a variant array where each element is a 
reference to a CTIOSClientLib.SkillGroup object.
To retrieve references to skill group objects you need to do something similar to 
what is shown in the following code example.