Hi,
I'm having the following issue and hope someone can help out:
I'm implementing an interface for a 3rd party application. One of the methods should return an array. The problem is that in this method I have to call a method of a COM object that is sitting on an extra form (for events to work) and this one returns the data with several events and signals when it's finished by a flag set in one of the returned objects.
So, somehow I need to find a way to block the method until all the data is returned from the call to the COM object.
Initially I was doing something like:
while(!myCollection.IsFinished)
Thread.Sleep(1);
This works when the class is created on a separate thread but when it's sitting on a WinForm it doesn't.
Any ideas
Thanks,
Tom

Block method until async operation finishes
Punch
while(!myCollection.IsFinished)
{
Thread.Sleep(1);
Application.DoEvents();
}
... before, which of course didn't work.
Steve Harding