Events in win32com

Paul Moore paul.moore at
Tue Dec 19 07:49:23 EST 2000

If I create an object using

obj = win32com.client.Dispatch(progid)

can I see events from the object? In WSH the CreateObject method has
an extra parameter which is the prefix for subroutine names which are
called on an event, something like

ie = WScript.CreateObject("InternetExplorer.Application", "ie_")

Sub ie_OnQuit()
End Sub

While I don't like the "specially named subroutine" approach, I do
need to be able to sink events in Python. Is this possible, or should
I resort to using Python via WSH?

(BTW, assuming I can sink events, will Python handle ByRef event
parameters - for example, a Cancel parameter which is set to True in
the handler to stop the event occurring).

Paul Moore

More information about the Python-list mailing list