homebrew311
Active member
- Joined
- Oct 25, 2003
- Messages
- 31
Every time I make a DLL and try to use it, the host program always returns a "Object reference not set to the instance of an object" error. What am I doing wrong?
Public Class Class1
Public Function Bob(ByVal int1 As Integer, ByVal int2 As Integer) As String
Dim Ans As Integer
Ans = int1 + int2
Return Ans
End Function
End Class
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
Dim DLL As Dll_Test_Dll.Class1
MsgBox(DLL.Bob(1, 2))
End Sub
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
Dim DLL As New Dll_Test_Dll.Class1 change this line
MsgBox(DLL.Bob(1, 2))
End Sub