[python-win32] COM Events

Tim Golden tim.golden at viacom-outdoor.co.uk
Fri Jul 9 12:16:37 CEST 2004


| Great that seems to work - but I only get my parent object in 
| this way:
| 
| agent = win32com.client.DispatchWithEvents 
| ("Agent.Control.2", AgentEvents)
| 
| What if I then get other objects as properties of this object -
| E.g.
| """
| SomethingElse = agent.Another
| """
| 
| And this object/interface has events too...

I'm going horribly out of my depth (or, in fact, out of my shallows) now,
but I have an idea that you can pass not just a class string, but
a dispatched object in as the first parameter to DispatchWithEvents.
ie you can do 

a = win32com.client.DispatchWithEvents ("x.y", xy_events_class)
b = win32com.client.DispatchWithEvents (a.z, az_events_class)

I could very well be wrong, having never tried it.

In any case, I *strongly* suggest you browse the generously-commented
source in win32com\client\__init__.py. On my machine, that's:

c:\python23\lib\site-packages\win32com\client\__init__.py

You're looking for DispatchWithEvents, obviously, but also
for the other related functions referred to in its docstring.

TJG


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


More information about the Python-win32 mailing list