We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

MainFrameBarManager and WaitAll

Thread ID:

Created:

Updated:

Platform:

Replies:

29547 May 27,2005 01:50 PM UTC May 31,2005 06:11 PM UTC WinForms 1
loading
Tags: Tools
Administrator [Syncfusion]
Asked On May 27, 2005 01:50 PM UTC

Hi! Sorry for my ugly english. I have next problem with threads and MainFrameBarManager control. There is minimal code that demonstates the problem (my project contains only single form and MainFrameBarManager control): private void button1_Click(object sender, System.EventArgs e) { const int numberOfThreads = 10; TT[] thrs = new TT[numberOfThreads]; ManualResetEvent[] events = new ManualResetEvent[numberOfThreads]; for(int i = 0; i < numberOfThreads; i++) { thrs[i] = new TT(); events[i] = thrs[i].event__; thrs[i].Start(); } WaitHandle.WaitAll(events, new TimeSpan(0, 0, 5), false); // On this code line environment throws unhandled exception: Additional information: WaitAll for multiple handles on an STA thread is not supported. } } public class TT { public ManualResetEvent event__ = new ManualResetEvent(false); public void Start() { new Thread(new ThreadStart(this.ThreadFunc)).Start(); } public void ThreadFunc() { this.event__.Set(); } } Without the control on the form this code working correctly. There is the error? Thanks in advance. Dive, Cuba/Varadero

Administrator [Syncfusion]
Replied On May 31, 2005 06:11 PM UTC

Hi Dive, Unfortunately, MainFrameBarManager cannot function in an MTAThread, since it requires DragDrop support. So the designer is likely setting the thread property to STA when you add the MainFrameBarManager, causing the error. Regards, Gregory Austin Syncfusion Inc.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;