Pumping message problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Robert Speck

    Pumping message problem

    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.


  • Gaurav Vaish \(www.EduJiniOnline.com\)

    #2
    Re: Pumping message problem

    "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


    --
    Happy Hacking,
    Gaurav Vaish | http://www.mastergaurav.com

    -------------------


    Comment

    • Robert Speck

      #3
      Re: Pumping message problem

      >"Control.lnvok e()" 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

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


      Comment

      Working...