[python-win32] COM: Parameterless functions seen as properties

Obendorf, Keston keston.obendorf at intel.com
Thu Sep 18 22:32:06 CEST 2008


Yes I have tried makepy. I haven't actually had any success with makepy
in the past except when running it on type libraries created with the
MIDL compiler. The gen_py modules created from tlbs exported from .NET
assemblies just don't work. They don't have definitions for any of the
methods of the classes, just the interfaces, and attempting to call any
of the interface methods on an instance grabbed by Dispatch fails with
an Attribute Error. 

 

Just an aside on how I'm getting the .tlb. When C# builds it generates a
.dll. I then use REGASM with the /tlb to register the .dll and export a
tlb from the dll and register that as well. 

 

I think I'll go poke around on the MSDN forums for awhile. 

 

_Keston 

 

________________________________

From: Mark Hammond [mailto:mhammond at skippinet.com.au] 
Sent: Wednesday, September 17, 2008 5:49 PM
To: Obendorf, Keston; python-win32 at python.org
Subject: RE: [python-win32] COM: Parameterless functions seen as
properties

 

The difference in behaviour of ITypeComp.Bind() is interesting, and I
agree is the main problem here.  However, from what you have said, I'm
surprised that a makepy-backed implementation isn't working for you.
The first thing we do when getting an object is ask for its type info so
we can get the CLSID of the object.  We then lookup the CLSID in our
makepy/gencache map, and if we find it, the entire process you outline
is skipped - we already know the dispid and flags for each of the
attributes.  Thus, given your objects implement most of the typeinfo
stuff correctly, I'm surprised this isn't working for you.

 

Have you tried running makepy on your typelib?

 

Cheers,

 

Mark

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20080918/3d6b4d8a/attachment.htm>


More information about the python-win32 mailing list