COM object pointer cast

Simon Brunning simon at
Mon Mar 27 18:23:09 CEST 2006

On 27 Mar 2006 00:19:09 -0800, Axel Bock < at> wrote:
> I am fooling around with the Python-COM bridge, and I have a little
> question with that.
> In the component I am using is a method which will return an "Entry"
> object - basically. In truth it returns some object which inherits from
> entry, and I know which one, but - as said - the method will only
> return the IEntry interface pointer. Now I would like to cast that one
> to the one I need :) . Is there an easy way to do it, or do I have to
> use the QueryInterface-method to get what I want?

There's an easy way - use win32com.client.CastTo(). See the script on this page -
<> for an

Simon B,
simon at,

More information about the Python-list mailing list