A
Altman
I am having problems with Declaring a function from a dll. I had it work in
VB 6 but I can't get it to work in VB.net. This was the call in VB6
Public Declare Function MBTConnect Lib "MBT" (ByVal szHostAddress As String,
ByVal port As Integer, ByVal useTCPorUDP As Long, ByVal requestTimeout As
Long, hSocket As Long) As Long
When I try this in VB.net I get the following Error:
"Object Reference not set to an instance of an object"
What I think is the problem is that hSocket is the connection handle if it
gets connected. This variable is then used in other calls. I think hSocket
is supposed to be set by the dll. I have tried both ByVal and ByRef on this
but neither seams to work.
VB 6 but I can't get it to work in VB.net. This was the call in VB6
Public Declare Function MBTConnect Lib "MBT" (ByVal szHostAddress As String,
ByVal port As Integer, ByVal useTCPorUDP As Long, ByVal requestTimeout As
Long, hSocket As Long) As Long
When I try this in VB.net I get the following Error:
"Object Reference not set to an instance of an object"
What I think is the problem is that hSocket is the connection handle if it
gets connected. This variable is then used in other calls. I think hSocket
is supposed to be set by the dll. I have tried both ByVal and ByRef on this
but neither seams to work.