473,725 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

com: makepy gencache.Ensure Module

Hello,

I' having a problem with gencache.Ensure Module:

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.Appli cation".

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.Ensu reModule('{801A 0000-A66C-11D3-A8BD-0000861EBBD6}',
0, 1, 0)

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

Then, in my code:
>>mod = win32com.client .gencache.Ensur eModule('{801A2 001-A66C-11D3-A8BD-0000861EBBD6}', 0, 1, 0)
mod
None
>>ob = win32com.client .Dispatch("SldW orks.Applicatio n")
ob
<COMObject SldWorks.Applic ation>

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

Thanks for your hints, Kai

Aug 10 '07 #1
0 1749

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

Similar topics

5
9109
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 distutils.core import setup import py2exe
5
3529
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 to do for the same function in perl), into a VARIANT, However when i run the variant code.... 'serialIndex = win32com.client.pythoncom.VT_VARIANT'
1
2117
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 = Connection()
3
2692
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 win32. Portions Copyright 1994-2001 Mark Hammond (mhammond@skippinet.com.au) - see 'Help/About PythonWin' for further copyright information. >>> Failed to execute command: from win32com.client import makepy;makepy.main() Traceback (most recent call...
1
1740
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 after the uuid in the IDL file)? Most of the time the code below generates a file called BF79B6C5-47BE-11D2-BACD-006008060A3A.py. But one time it generated a directory with that same name. This directory contained several .py files.
0
1762
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 the error occurs at def ensuremodule(): gencache.EnsureModule('{00000201-0000-0010-8000-00AA006D2EA4}',0,2,1)
1
2725
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, ActivePython 2.4 (build 247) and Microsoft Word 11.0 Object Library (8.3), then I get the following SyntaxError, and on two different computers I tested this. More on the error below, but has anyone else had this problem? Will there soon be a newer...
5
7006
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 Wolfgang
1
1487
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 written mostly utilities for Developer Studio which work fine if a little slow, and a bit of junk for some other bits of the MS Office suite. However, now I'm a bit stuck. I've got this object, and the documentation and sample code imply that...
0
8889
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8752
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9179
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9116
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4519
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.