A
Alain Dekker
Hi,
I'm using WMI and C++ to get the CPU temperature. It works, in the sense
that I get the temperature, but the same temperature is returned all the
time.
For example:
A) I run my program immediately the computer is booted. It returns, say,
23.0C. If I then run my program 2 hours later, it is still 23.0C.
B) I boot the computer, wait 30 minutes, then run the program. It returns,
say, 52.0C. Again, if I run it later, I always get that value.
How do I "kick" WMI and get it to update temperature values? Why does it get
locked?
Note: I'm using the namespace:
BSTR bstrNamespace = (L"root\\WMI");
and the query:
BSTR strQuery = (L"Select * from MSAcpi_ThermalZoneTemperature");
and the class property:
BSTR strClassProp = SysAllocString(L"CurrentTemperature");
If I use the "Win32_Processor" query and "LoadPercentage" property, this
DOES update every time I ask for it.
Many thanks,
Alain
I'm using WMI and C++ to get the CPU temperature. It works, in the sense
that I get the temperature, but the same temperature is returned all the
time.
For example:
A) I run my program immediately the computer is booted. It returns, say,
23.0C. If I then run my program 2 hours later, it is still 23.0C.
B) I boot the computer, wait 30 minutes, then run the program. It returns,
say, 52.0C. Again, if I run it later, I always get that value.
How do I "kick" WMI and get it to update temperature values? Why does it get
locked?
Note: I'm using the namespace:
BSTR bstrNamespace = (L"root\\WMI");
and the query:
BSTR strQuery = (L"Select * from MSAcpi_ThermalZoneTemperature");
and the class property:
BSTR strClassProp = SysAllocString(L"CurrentTemperature");
If I use the "Win32_Processor" query and "LoadPercentage" property, this
DOES update every time I ask for it.
Many thanks,
Alain