Hi! gentlepeople,
Probably you might help me regarding this.. I'm new to these Vb.net language. My question is Does AddressOf is accepted in Vb.net?
in this VbCode i have the following components:
- MyAPI.bas (this contains SetCallbacks)
- Callback.bas (this contains the STATE_CALLBACK function)
| Code: |
' API declaration in myAPI.bas
Public Declare Function SetCallbacks Lib "tfm.dll" ( _
ByVal hConn As Long, ByVal pfnGuiCallback As Long, _
ByVal pGuiCallbackCtx As Long, ByVal pfnGuiStateCallback As Long, _
ByVal pGuiCallbackCtx As Long) As Long
|
Form with a button cmdCallback
| Code: |
Public Sub cmdCallback_click()
Result = SetCallbacks(Connection, 0&, 0&, AddressOf STATE_CALLBACK, 0&)
'''' Any Code here
End Sub
|
- i have this module Callback.bas a procedure function called STATE_CALLBACK
| Code: |
Function STATE_CALLBACK(ByVal pGuiCallbackCtx As Long, ByVal dwState As Long, ByRef pRes As Byte, ByVal Msg As Long, ByVal byProg As Byte, ByVal pSample As Long, ByVal pData As Long) As Long
|
How will i convert this to vb.net???! I have a module for the Callback..
what i did was with the same format
| Code: |
Result = SetCallbacks(Connection, 0, 0, AddressOf Callback.STATE_CALLBACK, 0)
|
and the error appeared was "AddressOf expression cannot convertes to integer because integer is not delegate type" Im getting stucked in here...
I really need this badly
Thanks for your kind help.