参考:https://msdn.microsoft.com/zh-cn/library/ms891243
SAFEARRAY* psa = NULL;//=new SAFEARRAY();
ipFissSchemeManager->get_Schemes(QStringConvertion::QStr2_bstr_t(strSchemeTable), &psa);
long lBound = 0, uBound = 0;
SafeArrayGetLBound(psa, 1, &lBound);
SafeArrayGetUBound(psa, 1, &uBound);
BSTR BSTRTemp;
BSTR HUGEP *pBSTR;
HRESULT hr;
long cElements = uBound-lBound;
// Get a pointer to the elements of the array.
hr = SafeArrayAccessData(psa, (void HUGEP* FAR*)&pBSTR);
for (long i = 0; i < cElements; ++i)
{
BSTR bstrTest = pBSTR[i];
}
SafeArrayUnaccessData(psa);
时间: 2024-10-09 20:16:12