Hi,

> > - - - - - - - -
> >     def AddTest(self,
> lpProperty=defaultNamedNotOptArg,
> > vValue=defaultNamedNotOptArg):
> >             """method AddTest"""
> >             return self._oleobj_.InvokeTypes(4, LCID, 1,
> (24,
> > 0), ((30, 1), (12, 1)),lpProperty, vValue)
> 
> Can you please try changing the 30 there to 8 (ie,
> changing from VT_LPSTR to
> VT_BSTR) and let me know if it works?


I tried changing the 30 to 8 in the above line. This
does *not* work either, although it gives a different
error this time:

>>> obj.AddTest('IsBuy', True)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"c:\Python24\lib\site-packages\win32com\gen_py\98B8AE14-466F-11D6-A27B-00B0D0F3CCA6x0x1x0.py",
line 610, in AddTest
    return self._oleobj_.InvokeTypes(4, LCID, 1, (24,
0), ((8, 1), (12, 1)),lpProperty, vValue)
pywintypes.com_error: (-2147352568, 'Bad variable
type.', None, None)


> Actually, better yet - if it *does* work, please
> open a new pywin32 bug at
> sourceforge.  If it *doesn't* work it may point at
> an error in the COM
> object.


I am not familiar with COM/pywin much.. so please bear
with my ignorance..

Does the error above show with some certainty that
it's a problem with the COM object?

I looked at the other COM objects in the API package
that this particular COM object belongs to. A few
other objects have a similar method that is documented
to accept a String and a Variant argument. They work
fine.

Their definitions in the makepy generated file look
like this:

        def Set(self, vKey=defaultNamedNotOptArg,
newVal=defaultNamedNotOptArg):
                """method Set"""
                return self._oleobj_.InvokeTypes(4, LCID, 1, (24,
0), ((12, 1), (12, 1)),vKey, newVal)

And these methods seem to work just fine. Is this
sufficient evidence to say that the AddTest method is
incorrectly implemented?

(Mark, thanks for helping!)

-Sumeet.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to