By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,276 Members | 1,979 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,276 IT Pros & Developers. It's quick & easy.

win32com typelib difficulty

P: n/a
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("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,
pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147467262, 'No such interface supported', None,
None) xyz = win32com.client.Dispatch("XYZ")
xyz <COMObject XYZ> xyz._print_details_() 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\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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.