次のコード スニペットがあります。
IUpdateSession *iUpdate;
IUpdateSearcher *updateSearcher;
ISearchResult* pISearchResults;
IUpdateCollection* pIUpdateCollection;
IStringCollection *pIStrCollCVEs;
IUpdate2 *pIUpdate;
long lUpdateCount;
...
CoCreateInstance(
CLSID_UpdateSession,
NULL,
CLSCTX_INPROC_SERVER,
IID_IUpdateSession,
(LPVOID*)&iUpdate
);
iUpdate->CreateUpdateSearcher(&updateSearcher);
printf("\n Searching updates");
updateSearcher->Search(_bstr_t(_T("IsInstalled = 0")), &pISearchResults);
printf("\n Following updates found..\n");
pISearchResults->get_Updates(&pIUpdateCollection);
pIUpdateCollection->get_Count(&lUpdateCount);
LONG lCount;
BSTR buff;
while (0 != lUpdateCount)
{
pIUpdateCollection->get_Item(lUpdateCount, &pIUpdate);
pIUpdate->get_CveIDs(&pIStrCollCVEs);
pIStrCollCVEs->get_Count(&lCount);
pIUpdate->get_Title(&buff);
printf("TITLE : %s \n", buff);
while(0 != lCount)
{
pIStrCollCVEs ->get_Item(lCount, &buff);
_bstr_t b(buff);
printf("CVEID = %s \n", buff);
lCount --;
}
printf("\n");
lUpdateCount --;
}
::CoUninitialize();
getchar();
エラー: エラー C2664: 'IUpdateCollection::get_Item': パラメーター 2 を 'IUpdate2 * *' から 'IUpdate * *' に変換できません
@Line43
IUpdate2 インターフェイスへのポインターを取得する方法、