Page 1 of 1

Visual Basic .NET and CoreTempInfoNET.dll

Posted: Sat Mar 12, 2011 8:58 pm
by FranzBauer
Hey Guys!

Sorry for my English - I can't it really good. It is translated with Google Translator.

I have tried to use the CoreTempInfoNET Library to read the Temperature.
Tried with this Code in VB2008:
Imports CoreTempInfoNET

Public Class Form1
Dim CTInfo As New CoreTempInfo

Private Sub Form1(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Class

Private Sub btn1_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn1.Click
lbl1.Text = CTInfo.GetTemp(0) ' Error
End Sub

End Class
I get an error at the commented position:

The Object reference is not set to an object instance.
But I do not know where is my mistake.
Other Librarys works without problems!

Can you find my mistake?

regards
FranzBauer

Re: Visual Basic .NET and CoreTempInfoNET.dll

Posted: Wed Mar 16, 2011 1:24 pm
by The Coolest
Here you go:

Code: Select all

Imports GetCoreTempInfoNET

Public Class Form1
    Dim CTInfo As New CoreTempInfo
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        If (CTInfo.GetData()) Then
            TextBox1.Text = CTInfo.GetTemp(0)
        End If
    End Sub
End Class
GetData() must be called before you can access the rest of the information