Look through this article, please:
http://msdn.microsoft.com/library/de...raddressof.asp
"Patrick Dugan" <(E-Mail Removed)> wrote in message
news:ekbHW6%(E-Mail Removed)...
>I am *trying* to convert a VB6 program to vb.net. One error I am getting
>that I cannot figure out is:
>
> 'AddressOf' expression cannot be converted to 'Integer' because 'Integer'
> is not a delegate type.
>
> This is the offending line where the error is located:
>
> res = UUIRTSetReceiveCallback(hDrvHandle, AddressOf IRReceiveCallback, Me)
>
> This is the sub routine it is calling from the "AddressOf"
>
> Public Sub IRReceiveCallback(ByVal IRCode As Integer, ByVal userData As
> Integer)
> Call PostMessage(frmMain.NewPtr, WM_GOT_RECEIVE, 0, IRCode)
> End Sub
>
>
> How can I modify this to use a "delegate"?