Pumping message problem

  • Thread starter Thread starter Robert Speck
  • Start date Start date
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.
 
"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.

No standard way.
Synchronize yourself.

I wish somebody proves me wrong... :D
 
"Control.lnvoke()" to block however until the first call completes. Is
No standard way.
Synchronize yourself.
I wish somebody proves me wrong... :D


Thanks for the feedback. It's unfortunate and I hope someone proves you
wrong also :)
 
Back
Top