Reinventing the wheel
March 28, 2024, 01:43:01 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Members Tags Login Register  
Del.icio.us Digg FURL FaceBook Stumble Upon Reddit SlashDot Ask Google Bookmarks MSN Live Spurl Technorati Yahoo My Web

Pages: [1]
  Print  
Author Topic: CPU Temperature  (Read 30300 times)
OK69
Good users
*
Posts: 2


View Profile
« on: April 02, 2009, 03:57:38 PM »

Testing the code on this page ...

http://www.ciuly.com/delphi/wmi/cpuSystemTemperature/index.html

... i returned an error "Invalid class" when running these lines...
Code:
strQuery := 'SELECT * FROM __InstanceCreationEvent within 5 WHERE TargetInstance ISA "'+className+'"';
Services.ExecNotificationQueryAsync(SinkClasses.DefaultInterface, strQuery, 'WQL', 0, nil, nil);

... using Delphi 2007 (the variable "className" defined as "GTemperature").

Note: I imported the type libraries "Active DS Type Library 1.0" and "Microsoft WMI Scripting Library 1.2"
Logged
Reinventing the wheel
« on: April 02, 2009, 03:57:38 PM »

 Logged
ciuly
Administrator
Good users
*****
Posts: 235



View Profile WWW
« Reply #1 on: April 03, 2009, 09:51:34 PM »

did you read the note on that page? Smiley
Quote

Note: works with GigaByte mainboards. maybe others, don't know.

the thing with WMI is that in order to have a certain functionality, one must have a WMI provider installed to provide that functionality. So, in order to read CPU temperature using WMI, you must have a WMI provider for your mainboard which will provide a class with that functinality. Class which can be called in any way. I suspect that the G from GTemperature coems from Gigabyte Wink
bottom line, you must find the class for your mainboards wmi provider that provides the CPU temperature. I never did try to find something generic. From what I remember, there are some WinAPI functions that can do this too. WMI_TemperatureProbe works on some systems as well. you just need to find the one taht works on your system. and if you try doing something for all systems, then you need to eitehr find something generic, OR, find most of the WMI classes and loop through them Smiley
Logged
OK69
Good users
*
Posts: 2


View Profile
« Reply #2 on: April 04, 2009, 12:11:19 AM »

Thank you very much for your help.

Greetings.
Logged
Reinventing the wheel
   

 Logged
Tags:
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC | Sitemap Valid XHTML 1.0! Valid CSS!
Page created in 0.039 seconds with 27 queries.