By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,687 Members | 2,228 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,687 IT Pros & Developers. It's quick & easy.

Multithreaded events in dll to prevent blocking

P: n/a
Opa

I have a synchronous socket dll which fires several events to a winforms
client.
The winform calls methods on the dll and the dll fires an event back on the
same thread. I want the dll to fire events back on a different thread, but
am not sure how to go about this.

The dll has many events,, each event has different event arguments, so must
I create a thread for each event?

Without these threads, my winform app sometimes seems to "miss" the events
fired from the dll.

Can anyone guide me with some sample code? Perhaps a url demonstrating this?

Thanks

Nov 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Opa" <Op*@discussions.microsoft.com> wrote in message
news:53**********************************@microsof t.com...

I have a synchronous socket dll which fires several events to a winforms
client.
The winform calls methods on the dll and the dll fires an event back on
the
same thread. I want the dll to fire events back on a different thread,
but
am not sure how to go about this.


Events are always fired on the same thread as the code raising the event. If
this might be a different thread from the one containing the message loop,
then the event handler must use Form.Invoke. Otherwise, you'll see the kind
of problem you've seen.

John Saunders
Nov 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.