473,789 Members | 2,799 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

win32com typelib difficulty

Software versions:
Python - 2.3.3
win32all extensions - build 163
OS- Win2000 SP4

I am having trouble in accessing a customer's proprietary COM type library.
After running makepy against the customer's typelib, I am still unable to
create a typed object, getting the following Python traceback (I have to
sanitize the customer's product, I have replaced it with XYZ):

Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on
win32
Type "help", "copyright" , "credits" or "license" for more information.
import win32com.client
xyz = win32com.client .Dispatch("XYZA pp") Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Python23\li b\site-packages\win32c om\client\__ini t__.py", line 95,
in Dispatch
dispatch, userName =
dynamic._GetGoo dDispatchAndUse rName(dispatch, userName,clsctx )
File "C:\Python23\li b\site-packages\win32c om\client\dynam ic.py", line 84,
in _GetGoodDispatc hAndUserName
return (_GetGoodDispat ch(IDispatch, clsctx), userName)
File "C:\Python23\li b\site-packages\win32c om\client\dynam ic.py", line 72,
in _GetGoodDispatc h
IDispatch = pythoncom.CoCre ateInstance(IDi spatch, None, clsctx,
pythoncom.IID_I Dispatch)
pywintypes.com_ error: (-2147467262, 'No such interface supported', None,
None) xyz = win32com.client .Dispatch("XYZ" )
xyz <COMObject XYZ> xyz._print_deta ils_() AxDispatch container XYZ
Methods:
Props:
Get Props:
Put Props:

If xyz is a <COMObject XYZ>, how do I invoke methods on it? I've already
tried the straightforward xyz.method1() call, and in this case I get:

Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Python23\li b\site-packages\win32c om\client\dynam ic.py", line 477,
in __getattr__
raise AttributeError, "%s.%s" % (self._username _, attr)
AttributeError: XYZ.method1

although I know that method1() is defined for this interface.
Any other suggestions on how to proceed with this TLB? I *really* want to
be able to write test scripts in Python, not in VB.

-- Paul


Jul 18 '05 #1
0 1912

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

Similar topics

3
7026
by: RJ | last post by:
Hi, I've been going over the Quick Start to Client side COM and Python and many other sources, but cannot find an example that will get my com/ActiveX .ocx USB device driver imported. The Excel and Word examples run fine. win32com.client.Dispatch("Excel.Application") etc., but how does one know the ("<foo>.<bar>") to type in? Excel looks only vaguely like "Excel.Application" in the com browser.
3
2689
by: Peter Sparago | last post by:
(Sorry in advance for the long post.) Hi, I'm having a great deal of difficulty buiding a Python COM extension. I am using the MSHTML ActiveX control in my application but I need to interact with and implement some Custom COM interfaces. All is well with the basic operation of the control using Python. Basically, I want to take over the right-click (context) menu from
1
2424
by: Tom Willis | last post by:
Just a general question. It seems in COM late binding is something that should be avoided if possible. Because python seems to be really good at doing thing dynamically I'm wondering why no one has figured out how to make the functionality in makepy fire automagically when you need it. For example, it would be nice if you are creating an object repeatedly(ADODB.Recordset) that some logic would trigger whatever
2
4145
by: list.repository | last post by:
Problem: Works fine when running python test.py but fails when executing test.exe. test.py: conn = win32com.client.gencache.EnsureDispatch('ADODB.Connection') conn.Open("Provider='SQLOLEDB';Data Source='.';Initial
2
7100
by: Sibylle Koczian | last post by:
Hello, I've installed Python 2.4 and the win32 extensions, using administrator rights, under Windows XP in "C:\Programme". As this is a directory without spaces I didn't expect any problems. But now I can't _use_ win32com as a normal user, because normal users can't write there: PythonWin 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32. Portions Copyright 1994-2004 Mark Hammond (mhammond@skippinet.com.au) -
4
4663
by: John Salerno | last post by:
Is there anything better to read on how to use this module for working with Office programs? This is not very heartening to read in the official docs: ----------------------- How do I know which objects are available? Good question. This is hard! You need to use the documentation with the products, or possibly a COM browser. Note however that COM browsers
1
996
by: bli | last post by:
I have been developing an application driving a device through COM. I used win32com (brilliant ) and was at a fairly advanced stage being able to access the functions of the device and access/ retrieve its data. A week or two ago I did some overdue upgrading to all the components of the application.win32com, python to 2.4.4 and wxpy to latest. Then the problem began (I think!). My app still accesses the device and some functions still...
11
7741
by: Bill Davy | last post by:
I am trying to edit Contacts in Outlook. This is so I can transfer numbers from my address book which is an Excel spreadsheet to my mobile phone. I came across the following snippet of code which enabled me to the contacts at least list. I had to root around to discover CdoDefaultFolderContacts (though it was guessable; how could I enumerate win32com.client.constants?). I now want to work through the Contacts in Outlook patching in...
4
3613
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 = ChartObjects(1) works in pythonWin but doesn't work in IDLE. however, on both co = chartobjects(1) works just fine.
0
9665
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
9511
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
10408
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10199
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...
0
9983
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
7529
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
5417
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...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2909
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.