[python-win32] COM server AddIn

Mark Hammond mhammond at skippinet.com.au
Thu Jul 7 04:42:59 CEST 2005


> unfortunately I do not make any progress. The trace collector
> gives me the
> following output.
>
> Object with win32trace dispatcher created (object=None)
> pythoncom error: Failed to call the universal dispatcher
>
> Traceback (most recent call last):
>   File
> "C:\Programme\Python\Lib\site-packages\win32com\universal.py", line
> 173, in dispatch
>     retVal = ob._InvokeEx_(meth.dispid, 0, meth.invkind,
> args, None, None)
>   File
> "C:\Programme\Python\Lib\site-packages\win32com\server\policy.py",
> line 330, in _InvokeEx_
>     return self._invokeex_(dispid, lcid, wFlags, args, kwargs,
> serviceProvider)
>   File
> "C:\Programme\Python\Lib\site-packages\win32com\server\policy.py",
> line 647, in _invokeex_
>     return DesignatedWrapPolicy.c( self, dispid, lcid,
> wFlags, args, kwArgs,
> serviceProvider)
>   File
> "C:\Programme\Python\Lib\site-packages\win32com\server\policy.py",
> line 593, in _invokeex_
>     raise COMException(scode=winerror.DISP_E_MEMBERNOTFOUND)
> # not found
> win32com.server.exception.COMException: (-2147352573, 'Mitglied nicht
> gefunden.', None, -1)
>
> How can I see the values of the arguments passed to function
> ._InvokeEx_?

Yes, sadly the logging facilities of the "universal" code isn't as good as
the standard IDispatch code.  It would be nice to upgrade that.

For now you are probably limited to adding print statements to the relevant
code referenced in the traceback.  At the top of the traceback
(universal.py), the lines around the error are:

        ob._dispid_to_func_[meth.dispid] = meth.name
        retVal = ob._InvokeEx_(meth.dispid, 0, meth.invkind, args, None,
None)

printing meth.name should give you an indication.

> Is there any way to get the debugger stop in one of the _InvokeEx_
> functions?

It depends on your debugger - most have a way to break into the debugger by
having your code call some special function provided by the debugger.  You
could add a call to such a function in universal.py.

Mark



More information about the Python-win32 mailing list