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
--
Jeffery Hicks
Microsoft PowerShell MVP
http://www.scriptinganswers.com
http://www.powershellcommunity.org
Now Available: WSH and VBScript Core: TFM
Coming Soon: Windows PowerShell: TFM 2nd Ed.
"Alain Dekker" <abde...@NOSPAM.fsmail.net> wrote in message
news:uiDWdwrJ...@TK2MSFTNGP06.phx.gbl...
http://www.coolmon.org/index.php
At least you'll be able to verify your CPU temp outside of WMI.
--
Jeffery Hicks
Microsoft PowerShell MVP
http://www.scriptinganswers.com
http://www.powershellcommunity.org
Now Available: WSH and VBScript Core: TFM
Coming Soon: Windows PowerShell: TFM 2nd Ed.
"Alain Dekker" <abde...@NOSPAM.fsmail.net> wrote in message
news:uiDWdwrJ...@TK2MSFTNGP06.phx.gbl...