OK, an update.
This code apparently works, but failed for me as I have a 32 bit compiled delphi app running under 64 bit Windows 8 so the dll LoadLibrary call fails with system error 193.
Code: function GetNVDIATemp: integer; type NvCplGetThermalSettings = function(WindowsMonitorNumber: UINT;pGpuTemp, pUmgebTemp, pSlowDownTemp: Pointer): BOOL;stdcall; var hInstNvcpl: THandle; GetThermalSettings: NvCplGetThermalSettings; UmgebTemp, SlowDownTemp: cardinal; begin Result := 0; UmgebTemp := 0; SlowDownTemp := 0; hInstNvcpl := LoadLibrary('nvcpl.dll'); if hInstNvcpl <> 0 then try GetThermalSettings:= GetProcAddress(hInstNvcpl,'NvCplGetThermalSettings'); if Assigned(GetThermalSettings) then GetThermalSettings(0, Addr(Result), Addr(UmgebTemp), Addr(SlowDownTemp)); finally FreeLibrary(hInstNvcpl); end; end;
For calling a 64 bit dll from 32 bit dll there is apparently this code that may help http://cc.embarcadero.com/Item/27667
For now I give up.
Hopefully the above may help someone else who has the same issue.
|