2011/5/3 Mark Hammond <mhamm...@skippinet.com.au>:

> There is nothing magic about events - you need to provide your own magic :)
>  All the calls are still normal blocking calls - so if you want a model
> where methods on your com object are done in the background and fire when
> complete, you need to fully arrange for however that happens (be it threads
> or other non-blocking features.)  A win32 message queue is often used, which
> is why it is a common requirement that apps using such objects must ensure a
> message loop is running on the main thread.

Hmm
My application does not use any win32 functions aside of COM, so a simple

time.sleep(1)
pythoncom.PumpWaitingMessages()

loop started in a thread is sufficient ?

>

> DispatchWithEvents takes or creates a COM object, then instantiates a single
> instance of the event class and hooks it up with the object - so there is a
> 1:1 relationship.
OK
so the eventhandler should be implemented as a kind of singleton ?
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to