.NET     Console.WriteLine( "All Things .NET" );
.NET Nerd Blog Home
5.13.2003

 
Asynchronous Web Service Call
Proxy created by IDE for a given web service (e.g. ListCustomers) -- contains both sync and async methods.

BeginListCustomers( callbackWhenDone )

system uses thread from ThreadPool, then calls callback delegate.
However, you can't do any UI updating in this callback, since it's running on another thread.

public virtual IAsyncResult BeginInvoke(Delegate, object[]);
Executes the specified delegate asynchronously with the specified arguments, on the thread that the control's underlying handle was created on.

Now UI handler will be called on the main UI thread. From here, can do all your updating.

MSDN TV show about this here



Powered by Blogger