Glenn,

Do you have a pointer to the whole thread so that I can have a browse.

Thanks,
Rob.

Glenn Linderman wrote:
for swap stack trickery sounds bad... and I doubt we are doing it in Win32::GUI... Thought I'd put it here for the record, if nothing else.

-------- Original Message --------
To: [EMAIL PROTECTED]
Message-Id: <[EMAIL PROTECTED]>
Date: Fri, 09 Dec 2005 20:29:41 +0000
From: Nick Ing-Simmons <[EMAIL PROTECTED]>

Jan Dubois <[EMAIL PROTECTED]> writes:

On Fri, 09 Dec 2005, Nick Ing-Simmons wrote:

Jan Dubois <[EMAIL PROTECTED]> writes:
>Yes, both the original code, and the patch switching from NULL to (HWND)-1
>were from you.

I have no memory of the (HWND)-1 change at all :-(
Can you point me at the perforce change where I did it ?


http://public.activestate.com/cgi-bin/perlbrowse?patch=14160


Hmm, well it was obviously me. I can only assume I had been reading MSDN
help on PeekMessage() and saw the use mentioned.
It does look like a speculative change.


I assume that the change to (HWND)-1 was to avoid grabbing events
destined for GUI. If that is really a problem then I suppose WM_TIMER
events should be posted to a real (invisible?) window created for that
purpose.


Yes, that would be a possibility, but I would want to avoid the additional complexity if it is not needed. I'll check it out if this would solve the
issue on Windows 2003. Maybe it is trivial to do this.

I do sometimes worry about additional message pumps dispatching GUI messages
at "arbitrary" times during Perl execution, but I haven't found any real
issues yet. I think a problem would happen if you execute a Perl callback in response to a message, and while you are still in the callback, another
message triggers a different callback.  Couldn't the first callback mess
with the stack(s) of the second callback?


They can and they do. Which is why Tk does some swap-stack trickery
(thanks to Sarathy telling me how).


However, this happens all the time in GUI applications with modal
dialog boxes.


Quite, so GUI apps have to cope - what is less clear is what happens
to perl code (or core) that does not know there is a GUI.

Another area is COM synchronization, which also happens
through the message queue (using hidden top level windows for
non-GUI programs).  Every COM method call or property access will spin
the message pump and deliver GUI messages to windows too.

Cheers,
-Jan








Reply via email to