[python-win32] Re: DispatchWithEvents

Paul Moore pf_moore at yahoo.co.uk
Tue Jul 29 22:04:14 EDT 2003


"Janez Jere" <janez.jere at void.si> writes:

> Hi, I still haven't solved my DispatchWithEvents problem:
>
> Sample code, which works when conObj is created with Dispatch.
> Any suggestions? bellow is error output, and complete source.

No idea really, but when I hashed together a sample DispatchWithEvents
test a while ago, I had all of the callback functions' parameters
default to pythoncom.Missing - for example:

    def OnWillExecute(self, Source=pythoncom.Missing,
                            CursorType=pythoncom.Missing,
                            LockType=pythoncom.Missing,
                            Options=pythoncom.Missing,
                            adStatus=pythoncom.Missing,
                            pCommand=pythoncom.Missing,
                            pRecordset=pythoncom.Missing,
                            pConnection=pythoncom.Missing):
        pass

Whether the fact that you don't do this matters (maybe ADO is treating
whatever it's passing which *isn't* Missing as an invalid value), I
don't know. But maybe it'd be worth putting in the defaults and seeing
if that made a difference.

All I do recall is that getting ADO events working was tricky. I gave
up long before I ever found an application which justified the effort
:-)

Hope this helps,
Paul.
-- 
This signature intentionally left blank




More information about the Python-win32 mailing list