[python-win32] Simple Com Event Handling for Multiple ComObjects

Mark Hammond mhammond at skippinet.com.au
Tue Jun 27 02:07:46 CEST 2006


I'm afraid you probably need to pull win32com.client.WithEvents apart and
manually setup your own event handler class.  Different events do need
different functions (although it should be possible to add the same event
handler to 2 different event sources.

Cheers,

Mark

> -----Original Message-----
> From: python-win32-bounces at python.org
> [mailto:python-win32-bounces at python.org]On Behalf Of Nawal
> Sent: Monday, 26 June 2006 3:49 PM
> To: nawal
> Cc: python-win32 at python.org
> Subject: Re: [python-win32] Simple Com Event Handling for Multiple
> ComObjects
>
>
> Hello Everybody,
>
> Is there any simple way to handle all Com Events in a Simple Class?
>
> Nawal
>
> nawal wrote:
>
> > In activeX Scripting, I can Create Two Button Events Like
> >
> > OnButton1()
> > OnButton2()
> >
> > In Normal Python Com Event Handling: I have to declare two classes
> >
> > class ButtonEvent1
> >     OnButton()
> >           ...
> >
> >
> > class ButtonEvent2
> >     OnButton()
> >           ...
> >
> > and then attach this event handler to the Com Objects. Is there any
> > way I can achieve it
> > just like the ActiveX Scripting without creating more
> EventHandlerClasses?
> >
> > Thanks in advance.
> >
> > Nawal
> >
> >
> >
> >
> >
> >-------------------------------------------------------------
> -----------
> >
> >_______________________________________________
> >Python-win32 mailing list
> >Python-win32 at python.org
> >http://mail.python.org/mailman/listinfo/python-win32
> >
> >
>
> _______________________________________________
> Python-win32 mailing list
> Python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
>



More information about the Python-win32 mailing list