R
Robert Speck
Hi there,
Does anyone have a "standard" solution for the following "standard" problem.
If thread 1 invokes "MessageBox()" and thread 2 then comes along and invokes
some method on thread 1 (via "Control.Invoke()") which in turn invokes
"MessageBox()" again (or performs any other GUI operation for that matter),
the second call to "MessageBox()" will immediately succeed of course and
hence disable the first message box. All this works of course since
"MessageBox()" pumps its own messages (allowing the delegate I pass to
"Control.lnvoke()" to run immediately). I'd like the delegate I pass to
"Control.lnvoke()" to block however until the first call completes. Is there
a standard way of doing this in C# (.NET) or do I have to synchronize things
myself. Thanks.
Does anyone have a "standard" solution for the following "standard" problem.
If thread 1 invokes "MessageBox()" and thread 2 then comes along and invokes
some method on thread 1 (via "Control.Invoke()") which in turn invokes
"MessageBox()" again (or performs any other GUI operation for that matter),
the second call to "MessageBox()" will immediately succeed of course and
hence disable the first message box. All this works of course since
"MessageBox()" pumps its own messages (allowing the delegate I pass to
"Control.lnvoke()" to run immediately). I'd like the delegate I pass to
"Control.lnvoke()" to block however until the first call completes. Is there
a standard way of doing this in C# (.NET) or do I have to synchronize things
myself. Thanks.