Hello again, all-
I am still trying to understand Windows COM from Python. This time, I am trying to access a custom COM object an in-house developer has developed in C++. The class is stored in a dll registered with my system, and can be called from VB as follows:
From a working VB project:
' set up the input
Dim pConv As New SRS_CONLib.Point2D
However, when I try to call the clas via win32com, I get error messages.
In Python:
srs = win32com.client.Dispatch(r'SRS_CONLib.Point2D')
The error:
Traceback (most recent call last):
File "<pyshell#13>", line 1, in -toplevel-
srs = win32com.client.Dispatch(r'SRS_CONLib.Point2D')
File "C:\PYTHON23\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch
dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,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)
com_error: (-2147221005, 'Invalid class string', None, None)
The developer tells me the IDispatch interface is enabled, and the SRSCON_Lib.Point2D should be in the registry.
Thanks in advance for any assistance....
Eric
Eric B. Powell
E&GIS
BSRI
(803)952-7783
When a true genius appears in this world you may know him by this sign, that the dunces are all in confederacy against him. (Swift)
_______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32