Fog Creek Software
Discussion Board




Welcome! and rules

Joel on Software

Windows Forms Painting

I have a windows form application that queries a server in a long running process.  The query uses remoting.  To let the form paint properly while the query is running I launch it using an asynchronous beginInvoke method.  I expect the result to come back to by way of an Async result - this data is used to update the ui.

The question is ?

Am I better to use a callback and process the Async result and refresh the ui by way of another delegate.

Or

I use a do while loop with a timer running in the ui thread that checks for the Async result to complete and periodically and calls doEvents in the interim.


Any thoughts would be appreciated

Jonathan Lyall
Monday, September 23, 2002

You're using BeginInvoke to launch it - so then you should use the corresponding EndInvoke to process the results (that's if whatever you are calling is following the standard Async pattern).

Dunc
Monday, September 23, 2002

Thanks it is returned with async result.

But either way endinvoke is used to obtain the result.



Does anyone have a reason to not use DoEvents ?

Jonathan Lyall
Monday, September 23, 2002

*  Recent Topics

*  Fog Creek Home