472,338 Members | 1,610 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,338 software developers and data experts.

makepy support for versioning

Does makepy always respect versioning of interfaces? It appears as
though makepy correctly handles versioning of objects you obtain
directly, but not for objects you get via a function call.

Here's a simple example to illustrate the point. I created the
C++-based server for this example by pilfering some code in Andrew
Troelsen's book on COM and ATL.

car = Dispatch("ScriptibleCoCar.DualCoCar")
person = Dispatch("ScriptibleCoCar.Person") # a Person object
carOwner = car.Person # also a Person
object

Both the Car and the Person classes have two versions, and makepy
handles this correctly:
car <win32com.gen_py.ScriptibleCoCar 1.0 Type Library.IDualCoCar2
instance at 0x17800328> person <win32com.gen_py.ScriptibleCoCar 1.0 Type Library.IPerson2
instance at 0x17800368>

(Notice the suffix 2 in both cases). OTOH, the Person object obtained
via car.Person is a version 1 thingie:
carOwner <win32com.gen_py.ScriptibleCoCar 1.0 Type Library.IPerson
instance at 0x14968112>

If I try to use QueryInterface to get a reference to a version 2
object, it fails:
IID_IPerson2 = "{38332D31-6631-48E9-B62E-449864003395}"
carOwner._oleobj_.QueryInterface(IID_IPerson2) Traceback (most recent call last):
File "<interactive input>", line 1, in ?
TypeError: There is no interface object registered that supports
this IID

Late binding works fine, however:
import win32com.client.dynamic
dcar = win32com.client.dynamic.Dispatch("ScriptibleCoCar. DualCoCar")
dperson = dcar.Person
dperson.Name, dperson.ID, dperson.Address # Address is new

in version 2
(u'Phony', 123, u'00 Anywhere Place')

I'm kinda stuck here. I could live with using late binding, but the
interface I need to use has a lot of properties with parameters, and
makepy seems like the easiest way to deal with those. So my questions
are:
1) Is there a way around this issue with makepy?
2) If not, is there a way to set the values of properties with
parameters using late binding?

Thanks for the help!

Jim
Jul 18 '05 #1
0 1251

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: bk | last post by:
hi, i'm using pythonwin 2.2.3 my programm reads and write the outlook-adress book using COM. for this i have to use the makepy utility. after i...
1
by: Alv Mart | last post by:
Hi, I ran makepy for ADO. After I installed a new version of python I have this error: Do you know why could I have this error? >>> from...
3
by: Gerson Kurz | last post by:
I have problems getting "COM makepy" working in ActivePython 2.3.2. This is what happens when I start "COM makepy" from the Pythonwin Menu: ...
2
by: Svenn-Ivar Svendsen | last post by:
Hi, I use the makepy tool in pythonwin to generate wrappers for my connection point (event) interfaces in a project. It works fine. The question...
0
by: Paul Keating | last post by:
I used MakePy to generate .py support for a COM dll. That created the file 30D58DAF-B538-45F1-8EFF-F69ABA2BA798x0x1x13.py I want to be sure...
1
by: Steve M | last post by:
When I use the COM Makepy utility on one computer with WindowsXP, ActivePython 2.3 and I select the library Microsoft Word 10.0 Object Library...
1
by: Chris Curvey | last post by:
I'm trying to track down a performance issue in my Windows code, and hotshot is telling me that the most time and calls are spent in these methods...
0
by: Kai Rosenthal | last post by:
Hello, I' having a problem with gencache.EnsureModule: I used win32com\client\makepy.py to successfully generate Python sources....
4
by: suzhi18 | last post by:
Hallo, I've a problem getting makepy running. When I start the tool on my machine with doubleclick everything is fine. But when I try this in my...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.