C
Christian Verdani
Hello,
i want to query the signal strength of the nearby accesspoints on my
notebook.
So far, i found out that i can query information via the WMI.
Can anyone tell me how to get the signal strength out of the result of the
query?
I am working with visual c++.
here is the code snippet i have tried with:
hres = pSvc->ExecQuery(
bstr_t("WQL"), bstr_t("SELECT * FROM
MSNdis_80211_ReceivedSignalStrength Where active=true"),
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL,
&pEnumerator);
IWbemClassObject *pclsObj;
ULONG uReturn = 0;
while (pEnumerator)
{
HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1, &pclsObj,
&uReturn); //WBEM_INFINITE
if(0 == uReturn)
{
cout << "Need to BREAK!" << endl;
break;
}
VARIANT vtProp;
VariantInit(&vtProp);
// Get the value of the Name property
hr = pclsObj->Get(L"Name", 0, &vtProp, 0, 0);
// wcout << " OS Name : " << vtProp.bstrVal << endl;
VariantClear(&vtProp);
}
can someone help me?
sincerly,
Cristian
i want to query the signal strength of the nearby accesspoints on my
notebook.
So far, i found out that i can query information via the WMI.
Can anyone tell me how to get the signal strength out of the result of the
query?
I am working with visual c++.
here is the code snippet i have tried with:
hres = pSvc->ExecQuery(
bstr_t("WQL"), bstr_t("SELECT * FROM
MSNdis_80211_ReceivedSignalStrength Where active=true"),
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL,
&pEnumerator);
IWbemClassObject *pclsObj;
ULONG uReturn = 0;
while (pEnumerator)
{
HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1, &pclsObj,
&uReturn); //WBEM_INFINITE
if(0 == uReturn)
{
cout << "Need to BREAK!" << endl;
break;
}
VARIANT vtProp;
VariantInit(&vtProp);
// Get the value of the Name property
hr = pclsObj->Get(L"Name", 0, &vtProp, 0, 0);
// wcout << " OS Name : " << vtProp.bstrVal << endl;
VariantClear(&vtProp);
}
can someone help me?
sincerly,
Cristian