[python-win32] VARIANT as byref parameter

Tim Roberts timr at probo.com
Wed Sep 17 20:43:36 CEST 2008


martin.prochnow at team6-kg.de wrote:
>
> > Is the parameter declared as [out,retval] in the type library?
>
> This is how the function is declared in the file that MakePy has
> generated:
>
>  def ReadVarBlock(self, pbBuff=defaultNamedNotOptArg,
> dwOffset=defaultNamedNotOptArg, dwLen=defaultNamedNotOptArg):
>   return self._oleobj_.InvokeTypes(58, LCID, 1, (3, 0), ((16396, 0),
> (3, 0), (3, 0)),pbBuff
>    , dwOffset, dwLen)
>
> > If so, then Python should create the variant and return it to you:
> >    varData = QueryNote.ReadVarBlock( 0, lValue )
>
> This line produces a type mismatch error.
>

Well, that implies that the buffer is an in/out variant, not an output. 
I'm not sure how to construct a buffer Pythoncom will correctly
translate in this instance.  Mark, maybe?

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list