[python-win32] VT_UI1 ByRef behavior

Kevin Patterson patter001 at gmail.com
Wed May 9 15:16:56 CEST 2007


Alrighty, I'll keep looking in to it. I think it is easy to make the buffers
get returned as a python list. Almost all the code exists to help with that.
The tough part is telling the COM that the array being passed IN needs to
become a Safe Array where the size of each element is only VT_UI1. The
buffer is a great thing for that and at first glance the only thing I can
think of would be to modify PyCom_VariantFromPyObject to check the size of
the number to see if it will fit in VT_UI1 (it is already doing this for
ints and longs)...but i think that would be way to dangerous...

I might still look into a proposal for changing the output, but for the
input, I can't think of how to do it any other way than what you already
have. Perhaps I will just have to write a script that searches my generated
file from makepy and creates a layer in the python code...instead of on the
C side...oh well...

-Kevin

On 4/29/07, Mark Hammond <mhammond at skippinet.com.au> wrote:
>
> > I was curious is there a way to prevent an array of VT_UI1's from being
> > converted to a buffer? Or perhaps a way to modify the file generated
> > from "makepy" to prevent the conversion?
>
> Nope, no such facility exists.  Feel free to propose a patch though.
>
> Cheers,
>
> Mark
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20070509/b09ad07b/attachment.html 


More information about the Python-win32 mailing list