Hi all,
I'm new to .NET and I'm trying to learn a bit about Threading...
I've got a simple example here which starts a new thread for 'DoTheWork'...
If I change the "customerID" parameter from 'ByVal' to 'ByRef', I get a compile error...
"Overload resolution failed because no accessible New can be called with these arguements"
How can I pass in a reference rather than a value when I start the new Thread?

I'm new to .NET and I'm trying to learn a bit about Threading...
I've got a simple example here which starts a new thread for 'DoTheWork'...
VB.NET:
Sub StartThread()
Dim myThread As New Thread(AddressOf DoTheWork)
myThread.Start(100)
End Sub
Sub DoTheWork(ByVal customerID As Integer)
Do
' the work
Loop
End Sub
If I change the "customerID" parameter from 'ByVal' to 'ByRef', I get a compile error...
"Overload resolution failed because no accessible New can be called with these arguements"
VB.NET:
Sub StartThread()
Dim customerIDValue as integer = 200
Dim myThread As New Thread(AddressOf DoTheWork)
myThread.Start(customerIDValue)
End Sub
Sub DoTheWork([B]ByRef[/B] customerID As Integer)
Do
' the work
Loop
End Sub
How can I pass in a reference rather than a value when I start the new Thread?