[python-win32] COM Events

Phil Hornby phil.hornby at accutest.co.uk
Fri Jul 9 13:21:19 CEST 2004


Tim,

Thanks loads that worked... Have been bashing my head against a wall for
about a week on this thing!!!

I probably should have done as you suggested and dived into the source - I
just hate having to do that - I like to use documentation - not that the app
I am trying to automate has particularly good docs on the COM server - I am
having to use an OLE/COM Viewer to find out what I can really do in the
latest version instead of what was available 3 or 4 versions ago!!

Anyway thanks tons again - I owe you a bevvie...;)

--
Phil  

> -----Original Message-----
> From: Tim Golden [mailto:tim.golden at viacom-outdoor.co.uk] 
> Sent: Friday, July 09, 2004 11:17 AM
> To: 'Phil Hornby'; 'Python Win32'
> Subject: RE: [python-win32] COM Events
> 
> | 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