miaofeng

following code is wrote by vc 6.0 for getting date with wmi,but the value returned in code are all variant type,if the data actually is a struct or arrarylist ,how can I covert and how can I continue to access its struct member. Any one who has wroten raletive codes,please give samples or some advice.thank you.

......

.....// assumpt that alreay connect to namaspace,and began to get property value

IWbemServices *pSvc

IEnumWbemClassObject* pEnumerator = NULL;

VARIANT vtProp;
CIMTYPE vtType;
BSTR HUGEP *pbstr;

IWbemClassObject *pclsObj;

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

while(pEnumerator)

{

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

if(0 == uReturn)
{
break;
}

......

hr = pclsObj->Get(L"List", 0, &vtProp, &vtType, 0);

// if code works fine,now how can I access list's member data.List is an arrary

}