[python-win32] how to generate an IPersistStream object?

Leo Jay python.leojay at gmail.com
Tue Jan 30 02:56:38 CET 2007


On 1/30/07, Mark Hammond <mhammond at skippinet.com.au> wrote:
> > i need to pass an IPersistStream object to a COM function,
> > and i find a type named PyIPersistStream in the manual of pywin32.
> >
> > but i don't know how to generate a PyIPersistStream object and pass it
> > to the function.
> > anyone could help me?
>
> Gabriel is completely correct - see ./win32com/demos/ietoolbar.py and
> ./win32com/test/testStreams.py for 2 samples that use this interface.
>

thanks to all of you for helping me.

do i have to implement the IPersistStream by my self?
regarding to IStorage and IStream, i can invoke StgCreateDocfile and
IStorage::CreateStream to generate corresponding objects.

i thought there must be some way to do that effectively, without
having to do all
trivial things by myself.

i went through all of the samples coming up with pywin32 before i post
this thread.
as to ./win32com/test/testStreams.py, it implements IStream and
IPersist interfaces
by itself (and the implementation is incomplete).
i don't think that's a good way to implement all of the interfaces
that i need, do you?

thanks.

-- 
Best Regards,
Leo Jay


More information about the Python-win32 mailing list