Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

using ExecQuery method of WMI,why the answer isn‘t come out?

$
0
0
hres = pSvc->ExecQuery(
        bstr_t("WQL"),
        bstr_t("SELECT * FROM Win32_USBHub WHERE Name='USB Composite Device'"),
        WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
        NULL,
        &pEnumerator);     -------------first project

hres = pSvc->ExecQuery(
        bstr_t("WQL"),
        bstr_t("SELECT * FROM Win32_USBHub WHERE DeviceID='USB\\ROOT_HUB20\\4&39F7627C&0'"),
        WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
        NULL,
        &pEnumerator);     -------------second project

the first project can get the result,but the second project can't get the result.So I think the

format of 'USB\\ROOT_HUB20\\4&39F7627C&0'is wrong .

how can I writte it with the right format?


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>