tagged [invoke]

Will multiple Control.BeginInvoke/Invoke calls execute in order?

Will multiple Control.BeginInvoke/Invoke calls execute in order? I need to know whether Control.BeginInvoke and Control.Invoke calls will execute in the order they are called. I have the following sce...

10 Dec at 14:1

Cleaning up code littered with InvokeRequired

Cleaning up code littered with InvokeRequired I know that when manipulating UI controls from any non-UI thread, you must marshal your calls to the UI thread to avoid issues. The general consensus is t...

Best Way to Invoke Any Cross-Threaded Code?

Best Way to Invoke Any Cross-Threaded Code? I know that this question has been asked before, but I'm looking for a way to: 1. streamline the creation of safe cross-threaded code. 2. reuse this code in...

2 Apr at 20:35

How to get return value when BeginInvoke/Invoke is called in C#

How to get return value when BeginInvoke/Invoke is called in C# I've this little method which is supposed to be thread safe. Everything works till i want it to have return value instead of void. How d...

Are Parallel.Invoke and Parallel.ForEach essentially the same thing?

Are Parallel.Invoke and Parallel.ForEach essentially the same thing? And by "same thing" I mean do these two operations basically do the same work, and it just boils down to which one is more convenie...

MethodInfo.Invoke performance issue

MethodInfo.Invoke performance issue I am reading and writing data to and from a file. The data in the file can be floats, doubles, ints etc. The type is not known until runtime. I will refer to data t...

25 Apr at 10:46

Invoke and BeginInvoke

Invoke and BeginInvoke Greetings, I am developing some application in C#. At the moment I'm dealing with threading and I have a question that I have in my mind. What is the difference between Invoke a...

23 May at 12:10

WPF invoke a control

WPF invoke a control How can I invoke a control with parameters? I've googled this up, but nowhere to find! [invoke ui thread](http://www.google.nl/search?num=100&hl=en&newwindow=1&safe=off&client=fir...

16 Apr at 09:31

Reflection: How to Invoke Method with parameters

Reflection: How to Invoke Method with parameters I am trying to invoke a method via reflection with parameters and I get: > object does not match target type If I invoke a method without parameters, i...

Can Delegate.DynamicInvoke be avoided in this generic code?

Can Delegate.DynamicInvoke be avoided in this generic code? This question is partly about delegates, and partly about generics. Given the simplified code: ``` internal sealed class TypeDispatchProcess...

Is there a way to do dynamic implicit type casting in C#?

Is there a way to do dynamic implicit type casting in C#? Given this class with an implicit cast operator: I can now do the fo

WPF Dispatcher.Invoke 'hanging'

WPF Dispatcher.Invoke 'hanging' I have a somewhat complex WPF application which seems to be 'hanging' or getting stuck in a Wait call when trying to use the dispatcher to invoke a call on the UI threa...

10 Nov at 23:58

The uncatchable exception, pt 2

The uncatchable exception, pt 2 I've filed a bug report on Microsoft Connect: [https://connect.microsoft.com/VisualStudio/feedback/details/568271/debugger-halting-on-exception-thrown-inside-methodinfo...

12 Jul at 20:36

Deadlock when invoking the UI thread from a worker thread

Deadlock when invoking the UI thread from a worker thread I have a deadlock when I invoke the UI thread from a worker thread. Indeed, the worker thread is blocked on the invoke line: The weird thing i...

15 Sep at 18:24

How do I open a window on a new thread?

How do I open a window on a new thread? I have a options window and a window that displays color based on these options and Kinect data. So far everything's on one thread (as far as I know; I haven't ...

22 Jan at 00:24

Speeding up Reflection Invoke C#/.NET

Speeding up Reflection Invoke C#/.NET There are plenty of posts on speeding up reflection invokes, examples here: [Speeding up Reflection API with delegate in .NET/C#](https://stackoverflow.com/questi...

23 May at 11:54

C# Multithreading -- Invoke without a Control

C# Multithreading -- Invoke without a Control I am only somewhat familiar with multi-threading in that I've read about it but have never used it in practice. I have a project that uses a third party l...

15 Nov at 23:30

C# DllImport with C++ boolean function not returning correctly

C# DllImport with C++ boolean function not returning correctly I have the following function in a C++ DLL Inside my C# class I have the following: ``` [DllImport("Whisper.dll", EntryPoint="Exist", Cal...

6 Jan at 14:8

Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on

Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on I have a scenario. (Windows Forms, C#, .NET) 1. There is a main form which hosts some user cont...

28 Dec at 23:57

Isn't blindly using InvokeRequired just bad practice?

Isn't blindly using InvokeRequired just bad practice? I am a novice programmer so I could be completely mistaken here, but this issue bugs me more then it should. This is actually a follow-up from [th...

Is it appropriate to extend Control to provide consistently safe Invoke/BeginInvoke functionality?

Is it appropriate to extend Control to provide consistently safe Invoke/BeginInvoke functionality? In the course of my maintenance for an older application that badly violated the cross-thread update ...