COM interfaces and inheritance

Rob Sykes Robert_NJ_Sykes at msn.co.uk
Tue Nov 19 12:23:38 EST 2002


Alan Kennedy <alanmk at hotmail.com> wrote in
news:3DDA31DA.D230CCB8 at hotmail.com: 

> Rob Sykes wrote:
> 
>> I'm having a problem with a (3rd party) IDispatch interface
> 
>> I'm struggling with the upcasting(?) - in Delphi there is
>> newBar := CreateFoo() as bar
>> 
>> What is the Python equivalent ?
> 
> There is no casting in python. All resolution of attribute and
> method names takes place at execution time. 

<slapping forehead>
I knew that, i knew that, i knew that
</slapping forehead>

It was being to forced to think in Delphi that threw me. The 'as'
operator works differently for COM objects (on the lines you have 
explained else-thread) than for bog-standard classes.

<snip>

Cheers,

-- 
Rob Sykes 

Born again Bairn                  | 'The despair I can live with.
rob at john-richard dot co dot uk |  It's the hope I can't stand'
(header email for spambots)       |  (Anon.)



More information about the Python-list mailing list