Re: Monitoring Threads
Kelly Baker <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.winforms |
|---|---|
| Message-ID | <002d01c771f5$50b42d20$f21c8760$@com> |
I am trying to make this dll generic, so anybody can use it in the future. I don't know what they might name their forms or controls on their forms. -----Original Message----- From: Discussion forum for developers using Windows Forms to build apps and controls [mailto:[email protected]] On Behalf Of Vince P Sent: Thursday, March 29, 2007 2:04 AM To: [email protected] Subject: Re: [DOTNET-WINFORMS] Monitoring Threads Reference any member that is a type of Control and is on the UI thread, and call BeginInvoke with a delegate. That will marshal to the UI thread. - THESE are the times that try men's souls. The summer soldier and the sunshine patriot will, in this crisis, shrink from the service of their country; but he that stands by it now, deserves the love and thanks of man and woman. Tyranny, like hell, is not easily conquered; yet we have this consolation with us, that the harder the conflict, the more glorious the triumph. > -----Original Message----- > From: Discussion forum for developers using Windows Forms to build apps > and controls [mailto:[email protected]] On Behalf Of > Kelly Baker > Sent: Wednesday, March 28, 2007 19:37 > To: [email protected] > Subject: [DOTNET-WINFORMS] Monitoring Threads > > I am still working on that dll that runs a process in a different > thread, > then raises a NewData event for the calling executable. I have redone > it > using the BackgroundWorker class to do my threading. I have a > System.Timers.Timer object that runs the RunWorkerAsync method. In the > RunWorkerCompleted event I raise the NewData event. But the executable > still raises the cross-threading error when I try to update the form > controls. Is there a way to programmatically get the thread ID that is > displayed on the Threads debug window? I would like to log what thread > is > active with each operation until I can find where my problem is. > > Thanks, > Kelly