Handling Com Events in Python (was Python and Windows Scripting Host)

Syver Enstad syver.enstad at sensewave.com
Wed Aug 9 19:37:00 EDT 2000


> Every file built by genpy has the following lines towards the start:
>
> # The following 3 lines may need tweaking for the particular server
> # Candidates are pythoncom.Missing and pythoncom.Empty
> defaultNamedOptArg=pythoncom.Missing
> defaultNamedNotOptArg=pythoncom.Missing
> defaultUnnamedArg=pythoncom.Missing

I've tried all the combinations of pythoncom.Missing and Empty (example
below), none works. Maybe Python doesn't support the datatypes in the
parameters or something.

The URL parameter is a VARIANT* as far as I can remember. Maybe that is
causing the trouble.

def OnDocumentComplete(self, pDisp = pythoncom.Missing, URL =
pythoncom.Empty):
        print "documentComplete"

Thanks to everyone on the newsgroup who've assisted a total newbie on
learning how to do COM programming in Win32 Python.






More information about the Python-list mailing list