Pumping message problem

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.
 
G

Gaurav Vaish \(www.EduJiniOnline.com\)

"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
 
R

Robert Speck

"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 :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top