You probably would want to either Queue these into the ThreadPool as
WorkItems and do a WaitAll, or use one of the overloads of the AsyncResult
object in your callbacks to do something similar. What I think you are saying
is that you need to not return until both calls are complete and both events
fired.
Look up the WaitOne, WaitAny and WaitAll objects in MSDN for some sample code.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com
"Glenn" wrote:
Quote:
I have a class which has an async function which uses begininvoke on a
delegate to run a private function in the class. The class has an
event which reports back i) a unique identifier for that instance and
2) the progress of the operation
>
on my form class I create a new background thread and I declare two
instances of the class.
>
I create an event handler and connect this up to the progress changed
event of both classes. The handler reports progress to the UI thread to
a certain control based upon the Unique ID in the event.
>
when i run this; class1's events are fired up until the function
completes then class2's events are fired , rather then the classes both
running and raises events at the same time.
>
can anyone see something i am doing wrong, or a concept I has
mis-understood?
>
>