码迷,mamicode.com
首页 > 编程语言 > 详细

读SAFEARRAY,内容是BSTR一维数组

时间:2015-07-31 10:25:00      阅读:189      评论:0      收藏:0      [点我收藏+]

标签:


参考: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);

读SAFEARRAY,内容是BSTR一维数组

标签:

原文地址:http://www.cnblogs.com/bibo/p/4691361.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!