Re: [DOTNET] Putting bits of UI on a secondary thread? (was Re: [DOTNET] Modeless WinForms Bug)

2002-05-31 Thread Chris Kinsman
exactly why I do it... You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.

Re: [DOTNET] Putting bits of UI on a secondary thread? (was Re: [DOTNET] Modeless WinForms Bug)

2002-05-29 Thread David A.
> -Original Message- > From: dotnet discussion [mailto:[EMAIL PROTECTED]] On Behalf Of > Matthew Adams > Sent: Wednesday, May 29, 2002 4:27 PM > To: [EMAIL PROTECTED] > Subject: Re: [DOTNET] Putting bits of UI on a secondary thread? (was Re: > [DOTNET] Modeless WinForms Bu

Re: [DOTNET] AOP to police thread affinity? (was Re: [DOTNET] Modeless WinForms Bug)

2002-05-29 Thread Ian Griffiths
"Mcmullan, Andy (Andrew)" <[EMAIL PROTECTED]> wrote: > What you are asking here is quite a lot. Every GUI object > would need to check on entry to every method call whether > the calling thread is the thread that created the object. Big > overhead in terms of code to be written, and big performan

Re: [DOTNET] Putting bits of UI on a secondary thread? (was Re: [DOTNET] Modeless WinForms Bug)

2002-05-29 Thread Matthew Adams
n a secondary thread? (was Re: [DOTNET] Modeless WinForms Bug) > As an aside, a quick experiment reveals that all appears to be fine if > you start the message pump on the worker yourself (with > Application.Run()), but it is still slightly rude, as that pool thread > will then have a m

[DOTNET] AOP to police thread affinity? (was Re: [DOTNET] Modeless WinForms Bug)

2002-05-29 Thread Mcmullan, Andy (Andrew)
e: [DOTNET] Modeless WinForms Bug Mathew, It sure would have saved me a lot of time if an exception had been thrown ! jeff You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.

Re: [DOTNET] Modeless WinForms Bug

2002-05-29 Thread Ian Griffiths
Presumably Microsoft thought that putting the System.Windows.Forms.Timer on the Windows Forms Toolbox would be enough of a clue that you were supposed to use that one for Windows Forms applications. I guess most VB developers will look there first, since they've always dragged timers off a tool b

Re: [DOTNET] Modeless WinForms Bug

2002-05-29 Thread Jeff Roberts
Chris, Until today, I did not even know that System.Windows.Forms.Timer existed. I needed a timer, so I looked in System and saw System.Timer. I assumed that was the class to use for a timer. How many other people will fall into this trap ? The other bitch I have is that the System.Window

Re: [DOTNET] Putting bits of UI on a secondary thread? (was Re: [DOTNET] Modeless WinForms Bug)

2002-05-29 Thread Matthew Adams
ehalf Of Chris Sells Sent: 29 May 2002 16:10 To: [EMAIL PROTECTED] Subject: [DOTNET] Putting bits of UI on a secondary thread? (was Re: [DOTNET] Modeless WinForms Bug) > As an aside, a quick experiment reveals that all appears to be fine if > you start the message pump on the worker you

Re: [DOTNET] Modeless WinForms Bug

2002-05-29 Thread Chris Sells
gt; Sent: Wednesday, May 29, 2002 8:04 AM Subject: Re: [DOTNET] Modeless WinForms Bug I created the form from my main form and called Show() from the Timer event. By the way I have a lot of code that uses the GUI from a System.Timer event. When I get the event, I create a Graphics object for the f

[DOTNET] Putting bits of UI on a secondary thread? (was Re: [DOTNET] Modeless WinForms Bug)

2002-05-29 Thread Chris Sells
> As an aside, a quick experiment reveals that all appears to be fine if > you start the message pump on the worker yourself (with > Application.Run()), but it is still slightly rude, as that pool thread > will then have a message queue created for it that may not have existed > before. I don't k

Re: [DOTNET] Modeless WinForms Bug

2002-05-29 Thread Jeff Roberts
I created the form from my main form and called Show() from the Timer event. By the way I have a lot of code that uses the GUI from a System.Timer event. When I get the event, I create a Graphics object for the from and draw it without any problems ! jeff You can read messages from the DOTNE

Re: [DOTNET] Modeless WinForms Bug

2002-05-29 Thread Matthew Adams
On Behalf Of Ian Griffiths Sent: 29 May 2002 15:49 To: [EMAIL PROTECTED] Subject: Re: [DOTNET] Modeless WinForms Bug I had assumed that he had created the window on one thread and then called Show on a different one. In that case it wouldn't work, it's definitely wrong, but you also do

Re: [DOTNET] Modeless WinForms Bug

2002-05-29 Thread Ian Griffiths
I had assumed that he had created the window on one thread and then called Show on a different one. In that case it wouldn't work, it's definitely wrong, but you also don't get an exception. This is an instance of a more general problem: although it's positively forbidden to use a Control from t

Re: [DOTNET] Modeless WinForms Bug

2002-05-29 Thread Jeff Roberts
Never returning from a Show() method would seem to be an exception in someones code to me ! You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.

Re: [DOTNET] Modeless WinForms Bug

2002-05-29 Thread Matthew Adams
2 15:09 To: [EMAIL PROTECTED] Subject: Re: [DOTNET] Modeless WinForms Bug Mathew, It sure would have saved me a lot of time if an exception had been thrown ! jeff You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop

Re: [DOTNET] Modeless WinForms Bug

2002-05-29 Thread Jeff Roberts
Mathew, It sure would have saved me a lot of time if an exception had been thrown ! jeff You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.

Re: [DOTNET] Modeless WinForms Bug

2002-05-29 Thread Matthew Adams
D] Subject: Re: [DOTNET] Modeless WinForms Bug Ian, Thanks, I'll try it. Shouldn't the Show() throw an exception ? jeff You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read mess

Re: [DOTNET] Modeless WinForms Bug

2002-05-29 Thread Jeff Roberts
Ian, Thanks, I'll try it. Shouldn't the Show() throw an exception ? jeff You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.

Re: [DOTNET] Modeless WinForms Bug

2002-05-29 Thread Ian Griffiths
That might be the problem. System.Timers.Timer calls you back on a thread from the system thread pool. Of course you're not allowed to do anything to the UI on such a thread. If you want to call Show from such a thread, then what you should be doing is using Control.Invoke to marshal the call b

Re: [DOTNET] Modeless WinForms Bug

2002-05-29 Thread Rama Krishna
ECTED] Subject: Re: [DOTNET] Modeless WinForms Bug Ian, I am using a "System.Timers.Timer" ! thanks You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com. You can read messages from the DOTNET archi

Re: [DOTNET] Modeless WinForms Bug

2002-05-29 Thread Jeff Roberts
Ian, I am using a "System.Timers.Timer" ! thanks You can read messages from the DOTNET archive, unsubscribe from DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.

Re: [DOTNET] Modeless WinForms Bug

2002-05-29 Thread Ian Griffiths
Which kind of timer are you using? (There are several different Timer classes in .NET.) -- Ian Griffiths DevelopMentor - Original Message - From: "Jeff Roberts" <[EMAIL PROTECTED]> I have a modeless form that works perfect when shown from a menu click event, but if I try to show it fr

[DOTNET] Modeless WinForms Bug

2002-05-29 Thread Jeff Roberts
I have a modeless form that works perfect when shown from a menu click event, but if I try to show it from a timer event, the Show() method never returns. Has anyone seen this, or know a way around it ? thank you You can read messages from the DOTNET archive, unsubscribe from DOTNET, or sub