Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

InvalidOperationException / Multithreading

Last post 07-23-2008 4:55 by commuterman. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-20-2008 10:06

    • TGroener
    • Not Ranked
    • Joined on 02-27-2008
    • Points 40

    InvalidOperationException / Multithreading

    Hello everbody,

    my multithreaded application uses the Infragistics.Win.Misc.UltraDesktopAlert-Objekt and recieved an InvalidOperationExption when using the Show-Method.

    I remberd the way by using a delegate an object.invoke but there isn't any Invoke-Method in the UltraDesktopAlert-Objekt.

    Any idea?

    Many Greetings from germany

    Thomas

    P.S. There is no chance to use a background-worker-objekt in this place :-(

    • Post Points: 20
  • 07-23-2008 4:55 In reply to

    Re: InvalidOperationException / Multithreading

    I don't know if this helps, but I marshal the thread back to the UI thread by calling this.InvokeRequired and this.Invoke where "this" is the form on which the UltraDesktopAlert is contained.  I'm not an experienced developer so my approach may be flawed, but it seems to work.

    (I've also tried using other controls, instead of "this", and they also seem to work.)  So I have code like the following.

    private delegate void safeBroadcast(BroadcastData data);

    private void DisplayBroadcast(BroadcastData data) {

    if (this.InvokeRequired) {

    safeBroadcast del = new safeBroadcast(DisplayBroadcast); this.Invoke(del, new object[ ] { data });

    }

    else {

    myDestopAlert.Show("myCaption", "myMessage");

    }

    }

    Steve

    • Post Points: 5
Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems