Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how can we access array object in WMI

8 views
Skip to first unread message

sachin

unread,
Oct 15, 2009, 5:40:39 AM10/15/09
to
Hi
using a wmi i execute a query for MSiSCSIInitiator_SessionClass
class.

This class consist of array of object of type MSiSCSIInitiator_ConnectionInformation class.

How can i access this array or itrate through this array .

will safearray help me here to get information?
or do i need to declare a varient array structure


hres = pSvc->ExecQuery(
bstr_t("WQL"),
bstr_t("SELECT * FROM MSiSCSIInitiator_SessionClass"),
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
NULL,
&pEnumerator
);

//enumeration
IWbemClassObject *pclsObj = NULL;
pclsObj = NULL;
ULONG uReturn = 0;
while (pEnumerator)
{

HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1,
&pclsObj, &uReturn);

if(0 == uReturn)
{
break;
}

//do i need to declasre a VARIENT ?
how can i access a array of object to get a vaule?


Thanks,
Sachin


EggHeadCafe - Software Developer Portal of Choice
Silverlight 2 Custom Stock Charts With Silverlight Toolkit
http://www.eggheadcafe.com/tutorials/aspnet/5b0c5717-2817-47a5-bd20-1bbdc0ab1240/silverlight-2-custom-stoc.aspx

0 new messages