> I believe that "no such reentrancy" is sightly inaccurate... agreed
> that
> OnTimer() (the message version) doesn't interrupt the GUI
> thread, but if the handler for a timer does something that
> allows message processing (manually pumps messages to create
> a non-freezing pause, or even something as "innocent" as
> putting up a message box), then another timer message CAN
> re-enter the same code before the original has exited the routine.
>
> In this particular scenario it can't cause problems with multiple
> accesses to the same variable, but I felt it was important to clarify
> that it is possible for WM_TIMER reentrancy in some circumstances.
You're right, Jason. I was under the impression the the OP's code does
not run a message pump; but now that I look at it again, I see a message
pump right there beneath the innocent-looking AfxMessageBox( ) call (of
course, that is only an issue when the WM_TIMER handler calls
CExample::Increase( ).)
So, I correct myself: WM_TIMER handlers cannot be re-entered, unless
they run a message loop, and don't filter out new WM_TIMER messages.
-------------
Ehsan Akhgari
List Owner: [EMAIL PROTECTED]
[ Email: [EMAIL PROTECTED]; [EMAIL PROTECTED] ]
[ WWW: http://www.beginthread.com/Ehsan ]
Whoever fights monsters should see to it that in the process he does not
become a monster. And when you look long into the abyss, the abyss also
looks into you. -Beyond Good And Evil, F. W. Nietzsche
