Multi-threading issue
Hi All,
I have the following code. The code itself seems to work in that the thread is created and run, however when the thread hit's a line of code 'RaiseEvent' this does not get through to the Parent object. Can someone see from my code why that is?
Protected WithEvents clsDTS As New clsDTS()
Private Delegate Sub startThread()
Protected Sub btnCapture_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnCapture.Click
Dim myThread As New startThread(AddressOf clsDTS.Main)
Dim workerthread As New Thread(AddressOf myThread.Invoke)
workerthread.Name = "dtsMainThread"
workerthread.Priority = ThreadPriority.Normal
workerthread.Start()
End Sub
|