Hello

I have this code:

HTML Code:
Sub OnScanCallback(ByVal sData As String, ByVal wParam As Integer, ByVal lParam As Integer)
        
        FEISC_ScanSample.txtBox.Text = FEISC_ScanSample.txtBox.Text + sData
    End Sub

Function ReturnAddress(ByVal address As Integer) As Integer
        ReturnAddress = address
    End Function
when i tried to call it in the form
HTML Code:
    dim iMethod as integer

    imethod = ReturnAddress(AddressOf OnScanCallback)
then i received this error

"Error 1 'AddressOf' expression cannot be converted to 'Integer' because 'Integer' is not a delegate type."

any suggestions?
Thanks