Reading capabilities in c++
Here is sample C++ code which works in accsample deployed with the Open AIM SDK. You can copy and paste the below code and see the capabilities in a debugger.
void OnUserChange( IAccSession* session, IAccUser* oldUser, IAccUser*
newUser, AccUserProp Property, AccResult hr)
{
CAccVariant cv;
newUser->get_Property(AccUserProp_Capabilities, &cv);
SAFEARRAY *psa = V_ARRAY( &cv );
if(!psa)
{
printf(“Why can’t I get capabilities!!”);
}
int n = psa->rgsabound[0].cElements;
for (int i = 0; i < n; i++)
{
CAccVariant item;
long rgIndices[1];
rgIndices[0] = i;
SafeArrayGetElement(psa, rgIndices, &item);
}
}
