首页 > 编程语言 > 详细

读SAFEARRAY,内容是BSTR一维数组

时间:2015-07-31 10:24:23      阅读:181      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!