Questions tagged [cross-thread]

38 questions
5
votes
1 answer

Getting thread access exceptions on OnCollectionChanged after Creators Update

In my program, I have an abstract class ObservableKeyedCollection that inherits from KeyedCollection and also implements INotifyCollectionChanged. A realisation of this abstract class is bound to a ListBox. In this ListBox,…
tethered.sun
  • 149
  • 3
  • 14
3
votes
1 answer

How to cross thread calls in native C++ (call back on main thread)

I am implementing the C++ mobile apps to call some process which taking some times to make it done, but I need my apps main thread is still running without any blocking. Question: Is there any library that could just call runOnUIThread to get back…
Oktaheta
  • 606
  • 5
  • 21
2
votes
1 answer

How to force Task fire cross-thread exception

I have just updated the Visual Studio to 17.4.4. In the following code Thread fires cross-thread exception but Task doesn't. In the Start Without Debugging, Task still does nothing and Thread halts the application. How to force Task fires…
SHIN JaeGuk
  • 494
  • 1
  • 5
  • 14
2
votes
2 answers

How to use multiple background workers in a loop in which to start new work each iteration for each background worker in C#

I need to use 4 background workers to move 4 objects on a specific coordinates in parallel i.e. start them together and stop them together. I wrote a loop to loop 50 times and each time I need to start the workers and after they complete their work…
Rose
  • 349
  • 3
  • 17
1
vote
0 answers

Cross-thread operation not valid. How to display a progress bar and hide it after a process is done?

I know there are lots of topics on this issues. I looked at them, as well as at Microsoft's website, but I still don't know how to apply possible solutions to my case. So, I have a Windows Forms Desktop app that is supposed to read some text files…
1
vote
1 answer

CommonOpenFileDialog - Cross-thread operation not valid after call from UI thread

So I'm using the CommonOpenFileDialog from the windowsAPICodepack. In a previous version of the application I'm writing, the CommonOpenFileDialog worked without any problems. In the current version targeted at a higher version of the .Net Framework,…
Thomas
  • 43
  • 6
1
vote
0 answers

Why can my winform cross-thread access without error or exception

Recently, I tried to use multithreading in winform, and I copied a piece of code online. Unexpectedly, this code runs normally on my computer, and there is no cross-thread access exception. I want to figure out why. I use the .net4.0 csc compiler to…
MikeStrong
  • 11
  • 1
1
vote
0 answers

Cross-thread operation after using EventHandler

I needed to create an event in another class, so I've used an EventHandler and this works fine, however now in my main class form, when I try to use any controls I get: Cross-thread operation not valid So after researching I can…
chasher
  • 149
  • 11
1
vote
1 answer

C# DataBinding / Update DynamicObject property from another thread

Previously I was working on an implementation of DynamicObject data binding (see Dynamic object two way data binding), and the solution works great. Since then I have run into the need to be able to update the values from different threads it seems…
Aaron Murray
  • 1,920
  • 3
  • 22
  • 38
1
vote
0 answers

CrossThread Exception on Control's Parent

TabControl _tabControl; TabPage _tabPage; ListView _listView; /// this._tabControl.Controls.Add(this._tabPage); this._tabPage.Controls.Add(this._listView) /// private void UpdateListView() { If (_listView.InvokeRequired) { …
0
votes
1 answer

Does MediatR solve the WinForms cross-thread control update problem?

I've inherited a legacy WinForms app that is full of horrible threading issues and cross-thread form updates. The developer has made use of Control.BeginInvoke to marshal the calls but has not been very successful with it. I think the original…
Tim Long
  • 13,508
  • 19
  • 79
  • 147
0
votes
0 answers

How can I fix the 'cross-thread' error when another thread creates a new notification in my NotificationForm?

I have created NotificationForm to replace MessageBox, The notifications appear above each other, and wait 5 sec to disappear. Whenever a notification disappears the above ones go down to their new positions. The only problem I got is when another…
0
votes
0 answers

InvalidOperationException error in Invoke or BeginInvoke cannot be called on a control until the window handle has been created on BeginInvoke

InvalidOperationException error in Invoke or BeginInvoke cannot be called on a control until the window handle has been created on BeginInvoke i am getting an error while throw an exeception ex where the ex shown BeginInvoke error and can u refer…
0
votes
2 answers

Qt updating private class data from lamba/callback

Hi I'm a newbie in Qt and C++17 but I have to update a some private data from within a nested lambda function. These values are used to update the ui trough a timer: This's the main window class: class MainWindow : public QMainWindow { …
weirdgyn
  • 886
  • 16
  • 47
0
votes
1 answer

WPF Binding Exception

We have a WPF application using Prism 6.0 which have different screens that show collections. Many of these views are loaded in the startup and shown as necessary. Sporadically, we are getting an exception in the startup. The exception call-stack…
Pramod B R
  • 612
  • 6
  • 7
1
2 3