You've probably tried this, but...
I'm presuming mSync is a MethodInfo object...
How have you created it - i.e. has it been created from a dData object, and if so is this still in scope? It may be worth trying to use this rather than creating a new dData object.
The other thing to check is whether, if you create a new dData object and then do dData.Sync (or whatever is the name of the method mSync relates to) and pass in the relevant parameters. Does it work then? If so, there's a problem with how reflection is being used, otherwise there is something wrong with your parameters.
Quote:
quote:Originally posted by keane
I'm having a problem with some of my VB.net code, particularily in one of my thread synchronization methods.
Code:
Private Sub FireRecv(ByRef socket As TcpClient, ByVal data As String)
If mSync.InvokeRequired Then
mSync.Invoke(New dData(AddressOf FireRecv), New Object() {socket, data})
Else
RaiseEvent onDataRecv(socket, data)
doCommand(data) 'This is to get around not being able to listen to my own events
End If
End Sub
The line "mSync.Invoke(New dData..." is throwing an error that reads "Input string was not in a correct format.". I can't find what is causing this, the string in question is not null, I have added .ToString to everything I could find and nothing! It's really bugging me.
James
|