Illegal Cross Thread Operation?(softscenario.blogspot.com)
submitted by
animaonline(275) 4 years, 3 months ago
I see many forumposts solving this problem by simply adding the CheckForIllegalCrossThreadOperations=false;
While this is a totally legit workaround, it is highly thread-unsafe, and should only be used for debugging purposes. To be able to update for instance form-components from another thread, you will need to use delegates and invoke. Sounds scary? Not really.
A delegate is simply a "blueprint" that describes how a particular function or method should look. In C++ world, delegates are similar to Function pointers, but since we don't work with pointers in C# this is the closest we get. Still, function pointer is not a correct definition, as the delegate won't point to a function unless you make it do so. Here's an example:
|category: C#
|Views: 21
tags:
C++ Scenario software C# .Net another
Everyones tags:
Your Tags: