G
Guest
I am having problems when I run the following code. I get the error message
that the Object reference not set to an instance of the object. Does anyone
have any idea what I am doing wrong? I am trying to access unmanaged code in
a .dll.
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnCalculate.Click
Dim i As Integer
Dim press, temp As Single
Dim gas As New Fluid
press = 250.0
temp = 400.0
i = gas.Density(press, temp)
End Sub
Public Class Fluid
<DllImport("C:\Program Files\REFPROP\refprop.dll",
EntryPoint:="TPRHOdll", SetLastError:=True, _
CharSet:=CharSet.Unicode, ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function _
Density(ByVal Press As Single, ByVal Temp As Single) As Integer
End Function
End Class
that the Object reference not set to an instance of the object. Does anyone
have any idea what I am doing wrong? I am trying to access unmanaged code in
a .dll.
Private Sub btnCalculate_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnCalculate.Click
Dim i As Integer
Dim press, temp As Single
Dim gas As New Fluid
press = 250.0
temp = 400.0
i = gas.Density(press, temp)
End Sub
Public Class Fluid
<DllImport("C:\Program Files\REFPROP\refprop.dll",
EntryPoint:="TPRHOdll", SetLastError:=True, _
CharSet:=CharSet.Unicode, ExactSpelling:=True, _
CallingConvention:=CallingConvention.StdCall)> _
Public Shared Function _
Density(ByVal Press As Single, ByVal Temp As Single) As Integer
End Function
End Class