Sorry but this is not the solution for my Problem. I need help with my C++-Code above. That's why i have asked in this forum and not anywhere else ;)
M
Marcel Vogt
@Marcel Vogt
Posts
-
WMI getting IP-Address [modified] -
WMI getting IP-Address [modified]Hi, i'm using WMI to get some Parameters of the local Computer. Here is a Sample Code Snippet:
pEnumerator = NULL; hres = pSvc ->ExecQuery( bstr_t("WQL"), bstr_t("SELECT * FROM Win32_BIOS"), WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL, &pEnumerator); *pclsObj; uReturn = 0; while (pEnumerator) { HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1, &pclsObj, &uReturn); if(0 == uReturn) { break; } VARIANT vtprop; hr = pclsObj->Get(L"SerialNumber", 0, &vtprop, 0, 0); wcout << vtprop.bstrVal << endl; VariantClear(&vtprop); pclsObj->Release(); }
This works very well. How must i change this, to show the IP-Adressses of the Computer? Only with Changing to "Win32_NetworkAdapterConfiguration" and "IPAddress" instead of "SerialNumber" doesn't works. I think, because IPAdress is an Array in WMI?
modified on Saturday, June 19, 2010 12:50 PM