I have an object which is running on an STA thread.
Sub MyAsyncTask()
Do
MyWorker = New JobWorker()
MyWorker.Work()
Loop
End Sub
Protected InnerThread As New Thread(AddressOf Me.MyAsyncTask)
Public Sub Start()
Started = Now
InnerThread.SetApartmentState(ApartmentState.STA)
InnerThread.Start()
End Sub
There is code in my JobWorker class which creates an instance of a library object and sets up an event handler using a method on itself:
AddHandler libraryobject.ReceivedData, AddressOf Me.ReceivedData
This event fires normally without the threading code but once inside the object which is running off the STAThread it doesn't seem to fire anymore, any ideas?