|
-
Jun 12th, 2011, 11:37 AM
#1
Thread Starter
Frenzied Member
Send Varible to Sub on new thread
Hi again guys,
I have created a class with a public sub which has a varible with it using byval:
Public Class clsMessenger
Public Sub Messenger(ByVal Port As Integer)
End Sub
End Class
I now need to start that sub in a new thread and pass a varible to it but I am not entirly sure how to go about that.
At the moment I have:
Dim ClientConnection As New clsMessenger
Dim ClientThread As New Threading.Thread(AddressOf ClientConnection.Messenger)
ClientThread.Start()
I can't use a global varible because there is going to be multiple instances of this routine running on different threads and each time the varible to be passed will be different.
Any advice?
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|