Windows/COM events/strange behavior

Mark Hammond MarkH at
Mon Oct 22 15:42:32 CEST 2001

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)


More information about the Python-list mailing list