Windows/COM events/strange behavior
Krzysztof Czarnowski
Krzysztof.Czarnowski at dgt-lab.com.pl
Fri Oct 26 11:26:55 EDT 2001
on Mon, 22 Oct 2001 13:42:32 GMT
Mark Hammond wrote:
> Krzysztof Czarnowski wrote:
>
> > alive. The script is being started from a DOS prompt. Module "threading"
is
> > used. The COM event handler is constructed inside the thread and it
lives in
> > a "single threaded appartment" (CoInitialize(), loop
PumpWaitingMessages(),
> > CoUninitialize()).
>
>
> Sounds perfect :)
>
>
> > Then, when I start Pythonwin it gets stuck! When I stop the script
Pythonwin
> > seems to get released and starts (the window is displayed ...). Then I
can
> > run the script again without problems.
>
>
> What is the main loop doing. It too should be sitting on a
> PumpWaitingMessages() loop. Pythonwin is almost certainly waiting for a
> DDE request to finish, and somehow the script is blocking this DDE
> behaviour. Using "pythonwin /nodde" would help, but you may still find
> some other apps being similar things (eg, installer applications often
> block in these situations, etc)
>
> Mark.
I couldn't read the list for some time - sorry!
I really do observe the same behaviour with other apps (e.g. pfe file
editor).
My main thread loop is doing (slightly simplified):
while 1:
event_stop.wait(3)
if event_stop.isSet(): break
if msvcrt.kbhit():
k = msvcrt.getch()
if k in ['s', 'S']: break
The PumpWaitingMessages() loop is executed in a child thread. In parallel
another "CORBA child-thread" is working.
Krzysztof
More information about the Python-list
mailing list