Click here to Skip to main content
15,392,442 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionRe: Trouble creating a generic function Pin
Clark Kent12320-Oct-11 7:48
professionalClark Kent12320-Oct-11 7:48 
AnswerRe: Trouble creating a generic function Pin
Dave Kreskowiak21-Oct-11 2:05
mveDave Kreskowiak21-Oct-11 2:05 
GeneralRe: Trouble creating a generic function Pin
Clark Kent12321-Oct-11 2:29
professionalClark Kent12321-Oct-11 2:29 
QuestionHow to automatically Read and update Access database usin VB Pin
Member 808717520-Oct-11 4:37
MemberMember 808717520-Oct-11 4:37 
SuggestionRe: How to automatically Read and update Access database usin VB Pin
DaveAuld20-Oct-11 5:35
professionalDaveAuld20-Oct-11 5:35 
GeneralRe: How to automatically Read and update Access database usin VB Pin
Member 808717520-Oct-11 7:55
MemberMember 808717520-Oct-11 7:55 
GeneralRe: How to automatically Read and update Access database usin VB Pin
DaveAuld20-Oct-11 8:14
professionalDaveAuld20-Oct-11 8:14 
QuestionNVIDIA GPU temperature - VB.NET Pin
Member 807887019-Oct-11 13:41
MemberMember 807887019-Oct-11 13:41 
Hello everyone!

I'm trying to write a small application that will show the GPU temperature.
I'v found the following documentation about the subject:
http://developer.download.nvidia.com...lPanel_API.pdf

according to this documentation, I can use the nvcpl.dll file (which is a part of the NVIDIA driver) like this:

Function
Prototype
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 i wrote this code in VB.NET:

VB
<DllImport("nvcpl.dll", CallingConvention:=CallingConvention.Cdecl)>
Private Shared Function NvCplGetThermalSettings(ByVal nWindowsMonitorNumber As ULong, ByRef pdwCoreTemp As UInt32, ByRef pdwAmbientTemp As UInt32, ByRef pdwUpperLimit As UInt32) As Boolean
End Function

Public Function Temperature(ByVal monitornumber As Long) As UInt32
Dim core As UInt32
Dim ambient As UInt32
Dim upperlimit As UInt32
If NvCplGetThermalSettings(monitornumber, core, ambient, upperlimit) Then
Return core
Else
Return 0
End If
End Function

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MessageBox.Show(Temperature(0))
End Sub


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!
AnswerRe: NVIDIA GPU temperature - VB.NET Pin
Dave Kreskowiak19-Oct-11 15:41
mveDave Kreskowiak19-Oct-11 15:41 
GeneralRe: NVIDIA GPU temperature - VB.NET Pin
Member 807887020-Oct-11 0:22
MemberMember 807887020-Oct-11 0:22 
GeneralRe: NVIDIA GPU temperature - VB.NET Pin
Dave Kreskowiak20-Oct-11 1:48
mveDave Kreskowiak20-Oct-11 1:48 
AnswerRe: NVIDIA GPU temperature - VB.NET Pin
Luc Pattyn20-Oct-11 4:03
sitebuilderLuc Pattyn20-Oct-11 4:03 
GeneralRe: NVIDIA GPU temperature - VB.NET Pin
Member 807887020-Oct-11 5:31
MemberMember 807887020-Oct-11 5:31 
AnswerRe: NVIDIA GPU temperature - VB.NET Pin
Luc Pattyn20-Oct-11 7:07
sitebuilderLuc Pattyn20-Oct-11 7:07 
GeneralRe: NVIDIA GPU temperature - VB.NET Pin
Member 807887020-Oct-11 12:26
MemberMember 807887020-Oct-11 12:26 
AnswerRe: NVIDIA GPU temperature - VB.NET Pin
Luc Pattyn20-Oct-11 12:51
sitebuilderLuc Pattyn20-Oct-11 12:51 
GeneralRe: NVIDIA GPU temperature - VB.NET Pin
Member 807887020-Oct-11 13:07
MemberMember 807887020-Oct-11 13:07 
GeneralRe: NVIDIA GPU temperature - VB.NET Pin
Luc Pattyn20-Oct-11 13:35
sitebuilderLuc Pattyn20-Oct-11 13:35 
QuestionIIS 7 Recycle Schedule Settings via WMI Pin
Mr.EoniX18-Oct-11 23:41
MemberMr.EoniX18-Oct-11 23:41 
QuestionHow VB2008 set excel sheet header block (not sorting with its column)? Pin
Curious 200916-Oct-11 7:38
MemberCurious 200916-Oct-11 7:38 
QuestionInternet transfer control Pin
Magesa15-Oct-11 4:33
MemberMagesa15-Oct-11 4:33 
AnswerRe: Internet transfer control Pin
Dave Kreskowiak15-Oct-11 8:09
mveDave Kreskowiak15-Oct-11 8:09 
JokeRe: Internet transfer control Pin
Bernhard Hiller16-Oct-11 21:15
MemberBernhard Hiller16-Oct-11 21:15 
GeneralRe: Internet transfer control Pin
JR21216-Oct-11 22:34
MemberJR21216-Oct-11 22:34 
GeneralRe: Internet transfer control Pin
Magesa17-Oct-11 3:41
MemberMagesa17-Oct-11 3:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.