msxml3 and IStream interface

Mark Hammond MarkH at ActiveState.com
Sun Dec 31 01:14:47 CET 2000


David Bolen wrote:

> Mark Hammond <MarkH at ActiveState.com> writes:

> In a similar vein (already known interfaces versus not), I'm beginning
> to look/work more with the server side of things, and was wondering
> how one might go about using win32com to produce a COM server using a
> non-IDispatch interface, where that interface wasn't one of the
> predefined ones in pythoncom.
> 
> Your book doesn't seem to really touch the construction of
> non-IDispatch interfaces - is the most practical approach for me to
> build a typelib via standard means (compiling an IDL), then use makepy
> to define it for win32com, which then would let me declare it in the
> _com_interfaces entry in my class?

This will still only allow Python to implement it as (basically) an 
IDispatch based interface.  To implement a true vtable interface like 
IStream, you really hav 2 choices:
* Implement your own extension DLL, like win32comext\*.pyd
* Dig into "univgw", a tool that is 85% of the way to being able to 
implement arbitary vtable interfaces given a TLB definition.

> And if I'm intending to use these over DCOM and might involve
> non-standard marshaling code, is there a way to make that code
> available to win32com?

I understood that interfaces registered their own marshalling proxies 
explicitly in the registry, and that the COM framework itself would use 
these behind the scenes for you.  Of course, you still need to implement 
that marshalling code.

> Book and/or code pointers are fine (I've saved various COM stuff from
> you and Alex in the past which I'm still also going through).

I'm afraid you are already into "use the source" territory!

Mark.




More information about the Python-list mailing list