C
C.A.
I am looking at the Creating a Multi-User TCP Chat Application
and I do not understand something. They say that we cannot
directly add the received text to the textbox of the client because
the receiving thread from the network stream is not the main thread.
The solution offered is to use the me.invoke method to switch to
the main thread, i.e.
Me.Invoke(New DisplayInvoker(AddressOf Me.DisplayText), params)
I can't see how this switches back to the main thread, Me refers to
the current instance, which is not the main thread,
AddressOf Me.DisplayText is the address of DisplayText in the current
thread ?
and I do not understand something. They say that we cannot
directly add the received text to the textbox of the client because
the receiving thread from the network stream is not the main thread.
The solution offered is to use the me.invoke method to switch to
the main thread, i.e.
Me.Invoke(New DisplayInvoker(AddressOf Me.DisplayText), params)
I can't see how this switches back to the main thread, Me refers to
the current instance, which is not the main thread,
AddressOf Me.DisplayText is the address of DisplayText in the current
thread ?