> I am writing a Component whose work needs to be done on a separate
> thread (or ThreadPool), and when this work is done a Component event
[quoted text clipped - 14 lines]
> be the best way to do that? There is a MessageWindow class but it seems
> to be limited to the compact framework.
If you already *have* a UI thread, chances are you've got at least *a*
control visible - pass that (as an ISynchronizeInvoke) to the object
doing the work.
If you aren't guaranteeing that you've got a UI thread, you need to
have something running a message pump or something similar - a
producer/consumer queue could quite possibly do what you want. See half
way down
http://www.pobox.com/~skeet/csharp/threads/deadlocks.shtml
You could provide an API which allows the user to specify an
ISynchronizeInvoke to use, so they can do the most appropriate thing to
their situation, either passing in a control or possibly their own
implementation which uses something like the queue above if necessary.

Signature
Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Steve Whine - 13 Apr 2005 11:00 GMT
>>I am writing a Component whose work needs to be done on a separate
>>thread (or ThreadPool), and when this work is done a Component event
[quoted text clipped - 29 lines]
> their situation, either passing in a control or possibly their own
> implementation which uses something like the queue above if necessary.
Thank you Jon, I had not come across ISynchronizeInvoke, I will look
into it.