ALright, Ineed some help with the addressOf operator. I am using a .Dll file that requires a callback.
But I keep getting an error message "Invalid use of AddressOf operator". Here is an exerpt of my code.
From what I can tell, I'm using the AddressOf operator right, and I now it's not the .Dll. I've also tried using
a function like
But I still get the error. What am I missing? Thanks in advance.
1001100 1110101 1101011 1100101
But I keep getting an error message "Invalid use of AddressOf operator". Here is an exerpt of my code.
Code:
Private Declare Function client Lib "WinSox.dll" _
Alias "WinClient" (ByVal ip As String, ByVal port As Integer, ByVal addrFunct As Long) As Integer
Private Sub Command3_Click()
Dim nret As Integer
client "127.0.0.1", 8888, AddressOf showMsg
End Sub
Public Function showMsg() As Integer
MsgBox "showMsg()"
showMsg = 1
End Function
From what I can tell, I'm using the AddressOf operator right, and I now it's not the .Dll. I've also tried using
a function like
Code:
Private Sub Command3_Click()
Dim nret As Integer
client "127.0.0.1", 8888, FuncAddr(AddressOf showMsg)
End Sub
Private Function FuncAddr(ByVal pfn As Long) As Long
FuncAddr = pfn
End Function
But I still get the error. What am I missing? Thanks in advance.
1001100 1110101 1101011 1100101