Article ID: 112673
Article Last Modified on 12/9/2003
' MyLong is a function in a DLL that takes an unsigned integer as a
' parameter and returns the same value passed in. To run this sample you
' will have to create the MYLONG function. Enter the following Declare
' statement as one, single line:
Declare Function MyLong Lib "MyLong.DLL" (ByVal iInt AS Integer)
As Integer
Sub Command1_Click()
Dim lValue As Long
Dim i As Integer, w As Integer
' Initialize lvalue:
lValue = 40000
If lValue > 32767 Then
w = lValue - 65536
Else
w = lValue ' Just pass it on
End If
' Call a DLL that is expecting an unsigned integer.
' For this example, the MyLong function will return
' the same value passed in.
i = MyLong(w)
' Convert returned value:
If i < 0 Then
lValue = 65536 + i
Else
lValue = i
End If
' Display the results:
Print Str(lValue)
End Sub
Additional query words: 3.00
Keywords: KB112673