Multithreading...
-
Hello, I wanna write a multithreaded application and I am in need of a feature which is known to me in MFC, but I am unaware of in .NET. The problem is that I wanna spawn a worker thread from one of my forms. I can pass data to my worker thread from my dialog, but it is not enough to me, I also have to manipulate the UI controls of the caller from my worker thread. In MFC one can pass a pointer of the caller dialog to one's worker thread, which does the job. I am sure, there must be a similar thing in .NET too. Please help! Thanks in advance. Peter Molnar
-
Hello, I wanna write a multithreaded application and I am in need of a feature which is known to me in MFC, but I am unaware of in .NET. The problem is that I wanna spawn a worker thread from one of my forms. I can pass data to my worker thread from my dialog, but it is not enough to me, I also have to manipulate the UI controls of the caller from my worker thread. In MFC one can pass a pointer of the caller dialog to one's worker thread, which does the job. I am sure, there must be a similar thing in .NET too. Please help! Thanks in advance. Peter Molnar
System.ComponentModel.ISynchronizeInvoke
should provide the answers :) Every control implements that interface. top secret
Download xacc-ide 0.0.3 now!
See some screenshots -
Hello, I wanna write a multithreaded application and I am in need of a feature which is known to me in MFC, but I am unaware of in .NET. The problem is that I wanna spawn a worker thread from one of my forms. I can pass data to my worker thread from my dialog, but it is not enough to me, I also have to manipulate the UI controls of the caller from my worker thread. In MFC one can pass a pointer of the caller dialog to one's worker thread, which does the job. I am sure, there must be a similar thing in .NET too. Please help! Thanks in advance. Peter Molnar
Control
has anInvoke
method that should be used when you need to update a control from a thread other than the one that created it. UseInvokeRequired
to determine whether it is necessary to useInvoke
. Charlie if(!curlies){ return; }