473,395 Members | 1,652 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,395 software developers and data experts.

com: makepy gencache.EnsureModule

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 object I
get back is of type "COMObject" instead of one of the generated
classes.

In particular, I'm trying to interact with SolidWorks Extensibility
Type Library and the PROGID is "SldWorks.Application".

Using win32com\client\makepy.py -i
SolidWorks Extensibility Type Library
{801A0000-A66C-11D3-A8BD-0000861EBBD6}, lcid=0, major=1, minor=0
>># Use these commands in Python code to auto generate .py support
from win32com.client import gencache
gencache.EnsureModule('{801A0000-A66C-11D3-A8BD-0000861EBBD6}',
0, 1, 0)

Looking in win32com\gen-py, the appropriate file _does_ exist:
801A0000-A66C-11D3-A8BD-0000861EBBD6x0x1x0.py
and it does contain the correct class definitions.

Then, in my code:
>>mod = win32com.client.gencache.EnsureModule('{801A2001-A66C-11D3-A8BD-0000861EBBD6}', 0, 1, 0)
mod
None
>>ob = win32com.client.Dispatch("SldWorks.Application")
ob
<COMObject SldWorks.Application>

Why are the object mod is None and the object ob is <COMObject
SldWorks.Application instead <win32com.gen_py.<blah>>?
Any bright ideas as to what's going wrong here?

Thanks for your hints, Kai

Aug 10 '07 #1
0 1726

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

Similar topics

5
by: Giles Brown | last post by:
I'm feeling quite dumb this morning. I'm trying to build a COM server DLL using py2exe and it ain't working. Here's what ain't working... setup_dll.py based on py2exe sample: """from...
5
by: Matt Smith | last post by:
Hi, all. Just a quick question, when setting a COM process to read a value from a pre-defined register index, I think, I have to change the variable that the value will be returned to (as I have...
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 =...
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: PythonWin 2.3.2 (#49, Nov 6 2003, 10:18:20) on...
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: 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 (8.2), things work fine. When I have WindowsXP,...
5
by: eicwo01 | last post by:
Without to know the names, is it possible to dump all attributes of a com object? from win32com.adsi import * objDom = ADsOpenObject("LDAP:/ ... print ???"all attributes"??? of objDom Thanks...
1
by: Tom Plunket | last post by:
I don't know anything about COM beyond the fact that I can look in the OLE/COM browser to maybe figure out the API that an object has that I need to operate on. Usually this gets me by fine; I've...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.