471,119 Members | 1,483 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

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
Type "help", "copyright", "credits" or "license" for more information.
import win32com.client
xyz = win32com.client.Dispatch("XYZApp") Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "C:\Python23\lib\site-packages\win32com\client\__init__.py", line 95,
in Dispatch
dispatch, userName =
dynamic._GetGoodDispatchAndUserName(dispatch,userN ame,clsctx)
File "C:\Python23\lib\site-packages\win32com\client\dynamic.py", line 84,
in _GetGoodDispatchAndUserName
return (_GetGoodDispatch(IDispatch, clsctx), userName)
File "C:\Python23\lib\site-packages\win32com\client\dynamic.py", line 72,
in _GetGoodDispatch
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
pywintypes.com_error: (-2147467262, 'No such interface supported', None,
None) xyz = win32com.client.Dispatch("XYZ")
xyz <COMObject XYZ> xyz._print_details_() AxDispatch container XYZ
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\lib\site-packages\win32com\client\dynamic.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 1711

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by RJ | last post: by
3 posts views Thread by Peter Sparago | last post: by
1 post views Thread by Tom Willis | last post: by
2 posts views Thread by Sibylle Koczian | last post: by
4 posts views Thread by John Salerno | last post: by
1 post views Thread by bli | last post: by
11 posts views Thread by Bill Davy | last post: by
4 posts views Thread by sterling | 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.