An unhandled exception of type 'System.NullReferenceException' occurred

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • urukundappa
    New Member
    • Jan 2007
    • 1

    An unhandled exception of type 'System.NullReferenceException' occurred

    Hi this is chandu,

    can some help me out in this regard?

    I had created an Active X dll.

    I had registered it into the folder from where I want it to make it as .Net dll.

    I had used the command as

    tlbimp PhysServer.dll /out:NETPhysServ er.dll
    from the .net cmd prompt.

    Now I had written the code in vb.net as below to access this dll

    Private WithEvents moTemp As NETPhysServer.T emperature

    Private Sub cmdConvertToC_C lick(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles cmdConvertToC.C lick
    lblBelowFreezin g.Visible = False
    lblAboveBoiling .Visible = False
    With moTemp
    .Fahrenheit = txtFahrenheit.T ext
    txtCelsius.Text = .GetCelsius
    End With
    End Sub

    Private Sub cmdConvertToF_C lick(ByVal sender As System.Object, ByVal e As System.EventArg s) Handles cmdConvertToF.C lick
    lblBelowFreezin g.Visible = False
    lblAboveBoiling .Visible = False
    With moTemp
    .Celsius = txtCelsius.Text
    txtFahrenheit.T ext = .GetFahrenheit
    End With
    End Sub

    Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As System.EventArg s) Handles MyBase.Load
    ' moTemp = New NETPhysServer.T emperature
    End Sub

    Private Sub moTemp_AboveBoi ling() Handles moTemp.AboveBoi ling
    lblAboveBoiling .Visible = True
    End Sub

    Private Sub moTemp_BelowFre ezing() Handles moTemp.BelowFre ezing
    lblBelowFreezin g.Visible = True
    End Sub


    When I try to debug this code I am getting an erro saying
    "An unhandled exception of type 'System.NullRef erenceException ' occurred "

    Please help me out to figure out this
  • Niheel
    Recognized Expert Moderator Top Contributor
    • Jul 2005
    • 2432

    #2
    Discussion moved to .net forum.
    niheel @ bytes

    Comment

    • bplacker
      New Member
      • Sep 2006
      • 121

      #3
      do you know which line the error occured on?

      Comment

      Working...