C
cemi
Unregistered / Unconfirmed
GUEST, unregistred user!
CComVariant vBodyArr;
long i = -1;
SAFEARRAY* psaBody = V_ARRAY(&vBodyArr);
LPDISPATCH* pBodyDispArray = NULL;
long nBodyHighIndex = -1;
long nBodyCount = -1;
hr = SafeArrayAccessData(psaBody, (void **) &pBodyDispArray);
ASSERT(NULL != pBodyDispArray);
hr = SafeArrayGetUBound(psaBody, 1, &nBodyHighIndex);
nBodyCount = nBodyHighIndex + 1;
for (i = 0; i < nBodyCount; i++)
{
CComQIPtr <IBody2> pBody;
pBody = pBodyDispArray;
ASSERT(pBody);
hr = pBody->Select(VARIANT_TRUE, 0, &bRet);
ASSERT(bRet);
pBody.Release();
}
// Unaccess & destroy the component SafeArray
hr = SafeArrayUnaccessData(psaBody);
hr = SafeArrayDestroy(psaBody);
long i = -1;
SAFEARRAY* psaBody = V_ARRAY(&vBodyArr);
LPDISPATCH* pBodyDispArray = NULL;
long nBodyHighIndex = -1;
long nBodyCount = -1;
hr = SafeArrayAccessData(psaBody, (void **) &pBodyDispArray);
ASSERT(NULL != pBodyDispArray);
hr = SafeArrayGetUBound(psaBody, 1, &nBodyHighIndex);
nBodyCount = nBodyHighIndex + 1;
for (i = 0; i < nBodyCount; i++)
{
CComQIPtr <IBody2> pBody;
pBody = pBodyDispArray;
ASSERT(pBody);
hr = pBody->Select(VARIANT_TRUE, 0, &bRet);
ASSERT(bRet);
pBody.Release();
}
// Unaccess & destroy the component SafeArray
hr = SafeArrayUnaccessData(psaBody);
hr = SafeArrayDestroy(psaBody);