472,127 Members | 2,128 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

com: makepy gencache.EnsureModule


I' having a problem with gencache.EnsureModule:

I used win32com\client\makepy.py to successfully generate Python
Unfortunately, after I call win32com.client.Dispatch(), the object I
get back is of type "COMObject" instead of one of the generated

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
0, 1, 0)

Looking in win32com\gen-py, the appropriate file _does_ exist:
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)
>>ob = win32com.client.Dispatch("SldWorks.Application")
<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 1569

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Giles Brown | last post: by
5 posts views Thread by Matt Smith | last post: by
1 post views Thread by Alv Mart | last post: by
3 posts views Thread by Gerson Kurz | last post: by
1 post views Thread by Olaf Meding | last post: by
reply views Thread by Sam Sungshik Kong | last post: by
1 post views Thread by Steve M | last post: by
5 posts views Thread by eicwo01 | last post: by
1 post views Thread by Tom Plunket | last post: by
reply views Thread by leo001 | last post: by

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.