Raising Asynchronous Events from Components

G

Guest

I have a multi-threaded class that I am creating that needs needs to raise
events when certain asynchronous events occur. I would always like the
events to be raised to the primary UI thread of any application that is using
my component. I can't just call raiseevent from the thread that catches the
asynchronous data. (In this case from a serial port). This is because I
have a separate thread reading from the serial device. How can I marshall
the call such the event is raised on the primary UI thread?

My only solution right now is to use a Form Timer in the class and
repeatedly poll the thread to see if any events should be raised. Is there a
better way?
 
G

Guest

This sounds very promising. Thanks for the info. I couldn't access the
project you said you were attaching. Can you try to attach it again. I
would really like to see it.

Thanks,
John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top