You probably want to look at using makepy and see if the behaviour changes.

 

Note too that the "name" displayed by win32com may not correspond to the
type of the object at all, particularly when makepy isn't used or for
whatever reason the object doesn't support type information.  Are you
actually seeing a problem caused by what you describe?  If so, what?  If the
problem is that the methods etc from the sub-class aren't seen, then check
out win32com.client.CastTo()

 

Cheers,

 

Mark

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tibor Arpas
Sent: Wednesday, 16 July 2008 12:20 AM
To: [email protected]
Subject: [python-win32] COM Base Class and derived classes

 

Hi,
I'm new to both python and COM. I try to use the win32com.client. Many
things work like a charm, but I bumped into following problem. The COM
server has following hierarchy of types:

Component (Base class)
-----Folder
-----Drawing
-----Image
-----Form
-----Script
----- ......
 
The components are stored in a collection. When I try to access specific
component in my script I'm always getting the instance of "Component". 

>>> s.Document.ComponentSet['MyDrawing']
....  instance of Component ......


When I try the same thing in IronPython (the COM component has also .NET
interface and I use the clr library from IronPython), I get the specific
type. This confirms that at least some of my assumptions are right.
 >>>s.Document.ComponentSet["MyDrawing"]
<DrawingClass object at 0x0000000000000031>

Can anybody give some pointers where to look and what to check?
Regards,
Tibor

_______________________________________________
python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to