I'm trying to write a small application that will show the GPU temperature.
I'v found the following documentation about the subject:
according to this documentation, I can use the nvcpl.dll file (which is a part of the NVIDIA driver) like this:
BOOL CDECL NvCplGetThermalSettings
(IN UINT nWindowsMonitorNumber,
OUT DWORD* pdwCoreTemp,
OUT DWORD* pdwAmbientTemp,
OUT DWORD* pdwUpperLimit);
Parameters In UINT nWindowsMonitorNumber -- The display number shown on
the 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.
Now the problem is that this code keeps sending back 0, which means somethin is wrong here and the function is not working. It's been two days now and i still can't figure it out :S
I'd really appreciate any help.. thanks alot!
Instead of using Long for data types, use Integer. Long is a 64-bit integer whereas the C function header is specifying an unsigned int (unsigned 32-bit integer). In this case, it really doesn't matter if you use UInt32 or Integer.
don't worry too much about signed/unsigned integers, the one thing that matters is their size, and you got that right.
My best guess is: you are calling the function all right, and it fails, i.e. it returns false, probably (some googling suggests so) because you are running on Vista or higher, and giving you a temperature value is considered a risky thing to do.
I have windows 7 64bit.
with C/C++ it can be done and i'v seen it working, but i want to achieve this with VB.NET, that's the goal. google didn't help believe me i'v read evey possible related thread to this subject, and still found no answer.
actually i just checked again, it was a PureBasic code :S i didn't know this existed till now. I downloaded the code and checked it on my system (windows 7) and it gave perfect results.
The program uses different files, it use nvapi.lib and there is a different documentation for this library on how to access it and use it, but i dunno how i can use it with VB.NET. I don't think it's possible.
If that app uses a LIB file, there must be a DLL file as well. My Vista/32 system has an nvapi.dll file in its Windows\system32 folder. My Win7/64 system doesn't, as it doesn't have NVidia hardware.
If you have a DLL that holds the functionality implemented in native code, and the system authorizes you to do whatever it is the function does, then you can call it, from the language of your choice. For managed languages such as C# and VB.NET, that would mean one or more P/Invoke calls, DllImport attributes, and the lot. It is quite doable, your link should provide the necessary inspiration.
One issue that is likely to surface is 32-bit vs 64-bit. I suggest you try and build your managed code app as a 32-bit app (i.e. targetting "x86", not "x64" or "AnyCPU"). First check if and where nvapi.dll is present, it should be in either windows\system32 (which holds 32-bit code on Win32, and 64-bit code on Win64!!!) or windows\sysWOW64 (which holds 32-bit code only). Note: you cannot combine 32-bit and 64-bit code in a single process.
Im sitting here with a tricky VBScript question, specifically a need to set a IIS7 App Pool recycle schedule via VMI.
Currently this is in place - letting me set a specific time interval for an IIS7 App Pool, but this is not our strategy going forward, so i must enable a specific time of day where we recycle the Pool.
'*** Set Application Pool Recycling settings
Set objRecycling = objWMIService.Get("RecyclingSettings").SpawnInstance_
'objRecycling.DisallowOverlappingRotation = Null
'objRecycling.DisallowRotationOnConfigChange = Null
'objRecycling.LogEventOnRecycle = Null
objRecycling.PeriodicRestart = objPeriodicRestart
This works perfectly for a time interval, but as you can see the "Schedule" is outcommented. I've tried to set the schedule with the IIS6 approach which accepts an array of strings defining the times of day to recycle. But with NO luck.
Can any of you define what code is needed (objects, classes) to define a schedule that the IIS7 WMI accepts.
i want to use inet control to create directory in the directory at the remote server, and i have written the following codes which are running and no error msg, but no folder is created! anyone can help this?
No it's not easier it's different and no longer supported by MS and a lot of troubles when you want to used it in windows Vista or 7. 8 it almost there. Even more installing on these OS will have troubles also
Don't get me wrong. I have used it and I still used it for old programs that I didn’t get time to convert. It was very good in the prehistory; but now obsolete.
Thank you all for irrelevant reply, but it is good that i get my feet on and try to walk ahead. I have installed a VB2005, knowing that it is a good start for one who emancipate from VB6. The problem is that, real the controls that i have been using in VB 6 some of them are not found in vb2005, or may be there are replacement of them by name. for instance Inet control, i never found it in vb2005.
Then i decide to use VB 6 for new project because i found it still in some forums like this one.
anyone with some crucial project sample for VB2005???