hgeras Posted August 15, 2005 Share Posted August 15, 2005 (edited) I know not much about dll's but i can realize how im goin to call one once i have the reference for it ...But i have some issues with nvcpl.dll...From Nvidia:NvCplGetThermalSettings()Function PrototypeBOOL CDECL NvCplGetThermalSettings(IN UINT nWindowsMonitorNumber,OUT DWORD* pdwCoreTemp,OUT DWORD* pdwAmbientTemp,OUT DWORD* pdwUpperLimit);Parameters In UINT nWindowsMonitorNumber -- The display number shown onthe Windows Display Properties->Settings page.A value of 0 indicates the current primary Windows display device.DWORD* must be a valid pointer --pdwCoreTemp -- GPU temperature in degrees Celsius.pdwAmbientTemp -- Ambient temperature in degrees Celsius.pdwUpperLimit -- Upper limit of the GPU temperature specification.Return Values True on success.False on failure.How am i supposed to work with pointers? I tried this:$test=DllOpen("Nvcpl.dll") $ret=DllCall($test,"int","NvCplGetThermalSettings","int",0,"int_ptr","","int_ptr","","int_ptr","") if @error then MsgBox(0,"","ERROR") MsgBox(0,"",$ret[0] & ret[1]& ret[2])I always get "ERROR"...I have tried many variations of it and nothing seems to work...Should i use DllStruct()? And if yes how am i goin to use it in DllCall()?Thanx in advance.C ya Edited August 15, 2005 by hgeras Useful information about COM/Objects referenceMy Scripts:PapDefragNvidia Temperature Logger V3.0 with graph analyzerAutoiIt Update Checker And Downloader V1.0ArrayPush UDF Link to comment Share on other sites More sharing options...
Manko Posted September 11, 2008 Share Posted September 11, 2008 (edited) Sorry to bump this thread, but since I was searching for how to read GPU temperature and found this and other outdated code, I had to come up with a solution by myself, I thought I'd share:The part that got me stuck was that I needed to change calling convention from stdcall to cdecl, a problem I have been suffering for some time (DOH!!), like so: $ret = DllCall($test,"int:cdecl", "NvC....Dim $pdwCoreTemp Dim $pdwAmbientTemp Dim $pdwUpperLimit $nWindowsMonitorNumber=0 $test=DllOpen("Nvcpl.dll") $ret = DllCall($test,"int:cdecl", "NvCplGetThermalSettings", "int",$nWindowsMonitorNumber, "long*", $pdwCoreTemp, "long*", $pdwAmbientTemp, "long*", $pdwUpperLimit) if @error then MsgBox(0,"","ERROR") MsgBox(0,"",$ret[0] & " " & $ret[1] & " " & $ret[2])Ofcourse knowing if you have to call with INTs or LONGs is also good. Edited September 11, 2008 by Manko Yes i rush things! (I sorta do small bursts inbetween doing nothing.) Things I have rushed and reRushed:* ProDLLer - Process manager - Unload viri modules (dll) and moore...* _WinAPI_ProcessListOWNER_WTS() - Get Processes owner list...* _WinAPI_GetCommandLineFromPID() - Get commandline of target process...* _WinAPI_ThreadsnProcesses() Much info if expanded - optional Indented "Parent/Child"-style Processlist. Moore to come... eventually... Link to comment Share on other sites More sharing options...
rover Posted September 11, 2008 Share Posted September 11, 2008 Sorry to bump this thread, but since I was searching for how to read GPU temperature and found this and other outdated code, I had to come up with a solution by myself, I thought I'd share: The part that got me stuck was that I needed to change calling convention from stdcall to cdecl, a problem I have been suffering for some time (DOH!!), like so: $ret = DllCall($test,"int:cdecl", "NvC.... Dim $pdwCoreTemp Dim $pdwAmbientTemp Dim $pdwUpperLimit $nWindowsMonitorNumber=0 $test=DllOpen("Nvcpl.dll") $ret = DllCall($test,"int:cdecl", "NvCplGetThermalSettings", "int",$nWindowsMonitorNumber, "long*", $pdwCoreTemp, "long*", $pdwAmbientTemp, "long*", $pdwUpperLimit) if @error then MsgBox(0,"","ERROR") MsgBox(0,"",$ret[0] & " " & $ret[1] & " " & $ret[2]) Ofcourse knowing if you have to call with INTs or LONGs is also good. you should be able to replace $pdwCoreTemp, $pdwAmbientTemp and $pdwUpperLimit with 0 as the return array has the values can't test it though, one of my machines has an older Nvidia card (non gaming) that doesn't report temps I see fascists... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now