G
Guest
This is a 6.0 v. .NET question. In 6.0, you worked around the fact that
everything ran on the UI thread by judiciously invoking DoEvents to keep the
message queue clear. Using this approach I was able to write UIs that were
very responsive. Ironically, .NET has made this a lot harder to do by forcing
the programmer to solve the same problem with multi-threading. Granted that
makes the hard things possible, but the easy things hard. I'm using a
variation of BackgroundWorker to deal with my non-UI processing, but there is
still a problem that this doesn't solve. Suppose you have a form that has to
do some time-consuming processing before it can display itself, processing
that can't be separated out into another thread. In .NET there doesn't appear
to be any way to display some kind of busy state (e.g., hourglass cursor).
Because the form executes on the UI thread, the call to change the cursor
shape is not displayed in the UI until after the form completes its
processing. In 6.0, this is easily solved by calling DoEvents after the
cursor-change but before the Form is called. DoEvents still exists in .NET,
but doesn't seem to actually do anything. At any rate, this technique doesn't
work anymore. This seems like a pretty common basic scenario. How is it done?
Thanks.
everything ran on the UI thread by judiciously invoking DoEvents to keep the
message queue clear. Using this approach I was able to write UIs that were
very responsive. Ironically, .NET has made this a lot harder to do by forcing
the programmer to solve the same problem with multi-threading. Granted that
makes the hard things possible, but the easy things hard. I'm using a
variation of BackgroundWorker to deal with my non-UI processing, but there is
still a problem that this doesn't solve. Suppose you have a form that has to
do some time-consuming processing before it can display itself, processing
that can't be separated out into another thread. In .NET there doesn't appear
to be any way to display some kind of busy state (e.g., hourglass cursor).
Because the form executes on the UI thread, the call to change the cursor
shape is not displayed in the UI until after the form completes its
processing. In 6.0, this is easily solved by calling DoEvents after the
cursor-change but before the Form is called. DoEvents still exists in .NET,
but doesn't seem to actually do anything. At any rate, this technique doesn't
work anymore. This seems like a pretty common basic scenario. How is it done?
Thanks.