Anyone know if there is a way to call a function by address? (not using VB6)
Untill now I have been using an API call to do it for me:
This one works, but are prone to errors once in a while. Anyone else out there done anything like this, and know another better way to do this?Code:Private Declare Function SendMessageCallback Lib "user32" _
Alias "SendMessageCallbackA" (ByVal hwnd As Long, _
ByVal msg As Long, ByVal wParam As Long, _
ByVal lParam As Long, ByVal lpResultCallBack As Long, _
ByVal dwData As Any) As Long
Sub Main
call SendMessageCallback(hwnd, 256&, 16&, 2752513, AddressOf(MyFunc), s)
End Sub
Function MyFunc(ByVal hwnd As Long, _
ByVal umsg As Long, ByVal dwData As Long, _
ByVal lresult As Long) As Long
MsgBox "You called, master?"
End Function
