[python-win32] Problem using win32com.client.Dispatch on Win7 64bit

Eileen Wei ewei at Fekete.com
Thu Oct 14 18:40:57 CEST 2010


Hi everyone,

I am new to this group. I am not sure how to do search on the archives so if my question is duplicate please forgive me :)

I have Python 2.7.amd64 and pywin32-214.win-amd64-py2.7 installed on my Win7 64bit machine.

I am trying to use a COM object (the source of the COM is in C++ and MFC) in my python script. I registered the dll and tried to create a object and here is what I got:
>>> import win32com.client
>>> security = win32com.client.Dispatch("SWDBSecurityCOM.SWDBSecurity")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\win32com\client\__init__.py", line 95, in
Dispatch
    dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,c
lsctx)
  File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 104, in
_GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 84, in _
GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.II
D_IDispatch)
pywintypes.com_error: (-2147221164, 'Class not registered', None, None)
>>>

Note that I was able to successfully creating the object in my WinXP and Win7 32bit machine. So I am thinking the problem must be related to 64bit somehow.  How can I fix this?

Thanks,
Eileen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20101014/0e99dceb/attachment.html>


More information about the python-win32 mailing list