[python-win32] Re: COM Events

Thomas Heller theller at python.net
Fri Jul 9 15:03:36 CEST 2004


Tim Golden <tim.golden at viacom-outdoor.co.uk> writes:

> | 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.

Hm, isn't that what win32com.client.WithEvents is for?  At least the OP
should also look into that too.

Thomas



More information about the Python-win32 mailing list