I've this procedure
Expand|Select|Wrap|Line Numbers
- Private Sub ClientSocket_WriteCompleted(ByVal sender As Object, ByVal e As AsyncCompletedEventArgs)
- ...
- End Sub
Expand|Select|Wrap|Line Numbers
- Private Sub buttonConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles buttonConnect.Click
- ........
- ClientSocket = New SimpleClientTcpSocket()
- AddHandler ClientSocket.WriteCompleted, AddressOf ClientSocket_WriteCompleted
- End Sub
but always get an error for the AddHandler line
Error 1 Method 'Private Sub ClientSocket_WriteCompleted(sender As Object, e As System.ComponentModel.AsyncCompletedEventArgs)' does not have a signature compatible with delegate 'Delegate Sub Action(Of System.ComponentModel.AsyncCompletedEventArgs)(obj As System.ComponentModel.AsyncCompletedEventArgs)'.
It will only work if i change the procedure to
Expand|Select|Wrap|Line Numbers
- Private Sub ClientSocket_WriteCompleted(ByVal e As AsyncCompletedEventArgs)
- ...
- End Sub
Can anyone tell me what is wrong with the original code and how to solve it instead of removing the sender As Object in the procedure.
Thanks.