Windows/COM events/strange behavior

Krzysztof Czarnowski Krzysztof.Czarnowski at
Fri Oct 26 17:26:55 CEST 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"
> > used. The COM event handler is constructed inside the thread and it
lives in
> > a "single threaded appartment" (CoInitialize(), loop
> > CoUninitialize()).
> Sounds perfect :)
> > Then, when I start Pythonwin it gets stuck! When I stop the script
> > seems to get released and starts (the window is displayed ...). Then I
> > 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

My main thread loop is doing (slightly simplified):

while 1:
    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.


More information about the Python-list mailing list