Threading question

  • Thread starter Thread starter Phil
  • Start date Start date
P

Phil

Using C#/.NET 2.0

I have a form that starts a worker thread when the user wants to monitor
data coming from a com port. As new data is received on the com port, I use
a delegate to update a control on the main form.

When I close the main form, I get an error when I try to invoke the delegate
to update the main form. It tells me "Cannot access a disposed object.
Object name: 'Form1'."
I've tried setting the worker thread as a background thread and a foreground
thread, but both crash. Any ideas how to prevent this?
 
Back
Top