[python-win32] Re: Desire information about Invoke and InvokeTypes
Mark Hammond
mhammond at skippinet.com.au
Wed Apr 21 08:42:35 EDT 2004
Thanks for checking into it Roger! I asked the OP for a completely
stand-alone test case to run, as I really don't have the time to struggle
with Excel's charts :) I suspected (hoped!) I would find exactly what you
did though.
I'm relucatant to generalize the genpy process to assume that the type-info
may not be 100% accurate though - following that to its logical conclusion
means we are back to fully dynamic objects. I think that in this case, we
simply recommend a work-around:
ob = win32com.client.dispatch.DumbDispatch(ob)
should allow op.Add() to work correctly, using dumb dispatch.
Re the param parsing bug - I am sure you are correct :( It might not be too
hard to provoke via the C++ test object, which would be a good start :)
push(new_bug) # ly yr's
Mark.
-----Original Message-----
From: python-win32-bounces at python.org
[mailto:python-win32-bounces at python.org]On Behalf Of Roger Upole
Sent: Thursday, 22 April 2004 1:26 AM
To: python-win32 at python.org
Subject: [python-win32] Re: Desire information about Invoke and
InvokeTypes
I ran this in the debugger, and the return value is actually a VT_BOOL
(true), which
equates to 1. Since the return type at the C++ level is different from
what the typelib
specifies, I'd guess this is either bad type info in the typelib or a bug
in the Excel api itself.
Oddly enough, it succeeded after I ran makepy for the excel typelib
However, only
because it wraps the returned bool in the Series generated class.
The returned object is unusable, but at least it doesn't blow up.
It looks like there's a potential bug in the dynamic dispatch code,
though. InvokeTypes
can return a tuple if there are any out parameters to be returned, but
there's a slight
difference between the way the python code checks for out parameters (in
build.py)
and the way the C++ code determines it
(PythonOleArgHelper::ParseTypeInformation).
If the two come up with different interpretations of the number of out
params, you could
end up doing a Dispatch of a tuple.
hth
Roger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20040421/460e65a6/attachment-0001.html
More information about the Python-win32
mailing list