[python-win32] win32com events using native interfaces

Mark Hammond mhammond at skippinet.com.au
Fri Sep 16 00:12:07 CEST 2005


This should be possible with pywin32 - arbitrary interfaces can be
*implemented* by pywin32, just not called.

You will need to setup the event mechanism just as if they were IDispatch
based events.  However, you will also need to setup the COM event class to
reference the typelib and typelib interfaces like the win32com\test\pippo
samples.  It will probably be a little messing around as a direct sample of
this may be hard to track down, but it can be made to work.

hm - actually, on second thoughts, the demos\outlookAddin.py sample may be
very close - it is capable of catching events from excel, where those events
are in a typelib.  Alternative, see the spambayes plugin implementation for
a much larger example.

Mark

> -----Original Message-----
> From: python-win32-bounces at python.org
> [mailto:python-win32-bounces at python.org]On Behalf Of Michael Zuercher
> Sent: Friday, 16 September 2005 1:05 AM
> To: python-win32 at python.org
> Subject: [python-win32] win32com events using native interfaces
>
>
> I have a COM object that sends events. Rather that have the source
> interface be 'dispinterface' in the IDL, it is just 'interface'. Is
> there a way to catch events from this interface using win32com? The IDL
> for the coclass is below for reference.
>
> [
>    uuid(10020202-EB1C-11CF-AE6E-00AA004A34D5),
>    version(2.0),
>    helpstring("Data Transformation Services Package Object"),
>    helpcontext(0x000002ee)
> ]
> coclass Package2 {
>      interface _Package;
>      [default] interface _Package2;
>      [default, source] interface PackageEvents;
> };
>
>
> Michael Zuercher
> Zuercher Technologies LLC
> _______________________________________________
> 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