-
End Async Call
Hi,
Within a loop I have begin and invoke on a delegate.
ArrayList aresult = new ArrayList();
foreach(string companyName in companies)
{
aresult.Add(dlgt.BeginInvoke(companyName, amount, null, null));
}
The method is working correctly but I don't know how to end the invoke.
I did have this code in but it isn't always waiting for the result to complete. It doesn't seem to be waiting long enough.
foreach(IAsyncResult ar in aresult)
{
if(ar.IsCompleted == false)
ar.AsyncWaitHandle.WaitOne();
}
Do I need a callback or do I have to wait for the result to complete using a difference method.
Thanks
CD