Hi all

I have an application that launches an event asynchronously using the BeginInvoke method like this

if(FetchData != null)
{
   foreach(Delegate objDelegate in this.FetchData.GetInvocationList())
  {
    FetchDataHandler objFetchDataHandlerDelegate = (FetchDataHandler)objDelegate;

   objFetchDataHandlerDelegate.BeginInvoke(uniqueID, new AsyncCallback(OnFetchDataCompleted), null);
 }
}


inside the method that handles this event I raise a second event (synchronously).  The code that handles this second event updates the UI.  This code will test if Invoke is needed using InvokeRequired.  If it is needed it uses inVoke otherwhise it just updates the control.

This was working fine in 2003 but in 2005 i get the exception stating "Illegal cross-thread operation: control x accessed from a thread other then the thread it was created on."

How is this possible. i test if it need InvokeRequired, so how can it fail??

Thnx for any help!!