473,383 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

[PythonWin] MakePy and gencache.EnsureModule() do different things.

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 that this file is present and so I used MakePy -i to
construct a call to gencache.EnsureModule().

This is what it said:

{30D58DAF-B538-45F1-8EFF-F69ABA2BA798}, lcid=0, major=1, minor=13
# Use these commands in Python code to auto generate .py support
from win32com.client import gencache
gencache.EnsureModule('{30D58DAF-B538-45F1-8EFF-F69ABA2BA798}',

0, 1, 13)

But when I execute this code, it creates the support as a package,
that is, there is a _folder_ called

30D58DAF-B538-45F1-8EFF-F69ABA2BA798x0x1x19

(NB minor version is 19 not 13) with separate .py files for each
interface and class inside, and an __init__.py.

If the EnsureModule() call has not been called to generate the
package, then win32com.client.CastTo() fails when called with a
class-instance and interface defined in the COM dll. It complains that
it can't find the package ...x19.

Can anyone explain the version number difference (I realize that
19=0x13 but that doesn't help me understand it much), the
package/single file difference, and why Dispatch responds to the one,
but CastTo expects the other?
Jul 19 '05 #1
0 2199

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

Similar topics

0
by: bk | last post by:
hi, thank you for the hint, but i solved the problem myself. i didnt knew that that the following two lines in py-script must be added: from win32com.client import gencache...
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 ADODB import Connection,Recordset >>> conn =...
1
by: Olaf Meding | last post by:
When does the makepy utility generate a .py file and when a directory? And what decided if a directory or a file is generated? What is the difference between a file and a directory (both named...
0
by: Sam Sungshik Kong | last post by:
Hello! I use Python for ASP. When I request a page for the first time in a session, I get an error message like below. If I refresh the same page, it doesn't cause any error. I believe that...
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 ncalls tottime percall cumtime percall...
4
by: siggi | last post by:
Hi all, newbie question: I'd like to try speech synthesis with PythonWin 2.5. Problem ****** according to several instructions, such as found on...
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. Unfortunately, after I call win32com.client.Dispatch(), the...
0
by: Alan Meyer | last post by:
I had an unusual problem tonight running makepy to install some Microsoft COM interfaces in a Python 2.5 Windows XP installation created using the ActiveState installer. In earlier versions of...
4
by: sterling | last post by:
I'm curious as to why the difference between IDLE and pythonWin when using win32com. opening an excel file, i've attempted to grab the chart information out of the file. commands like co =...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.