sccs cscs wrote:
> Hello, Our team uses Visual Basic for Rhapsody Automation,
> but we now would like to use Python. But it seems to be IMPOSSIBLE.
> Indeed, it seems that there is no Polymorphism in Python so that when
> i get back
> a daughter instance Class, it does not not work, i continue to have
> the corresponding Mother Class.

This kind of interface inheritance is not commonly used in COM,
precisely because it is almost impossible to use in a dispatch-based
interface like what Python uses.  If Python believes that
findNestedElementRecursive returns an IRPModelElement, there's no good
way for it to know any differently.

If you know the object also implements IRPType, you can cast it:

  theIrpType = win32com.client.CastTo(theIRPModelElement, 'IRPType')


-- 
Tim Roberts, [EMAIL PROTECTED]
Providenza & Boekelheide, Inc.

_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to