Microsoft COM and "service" class
jim.vickroy
jim.vickroy at noaa.gov
Tue Jul 17 15:26:17 EDT 2001
Hello,
I'm attempting to implement a Python class that is both a Microsoft COM
object and a "service".
This is a traceback from a client attempting to use the object:
Traceback (most recent call last):
File "D:\applications\sec\sxi\test_com.py", line 3, in ?
com_obj = win32com.client.Dispatch ('SXI.processor_events_log')
File "D:\Python20\win32com\client\__init__.py", line 94, in Dispatch
dispatch, userName =
dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
File "D:\Python20\win32com\client\dynamic.py", line 80, in
_GetGoodDispatchAndUserName
return (_GetGoodDispatch(IDispatch, clsctx), userName)
File "D:\Python20\win32com\client\dynamic.py", line 71, in
_GetGoodDispatch
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147221231, 'ClassFactory cannot supply
requested class', None, None)
which I believe is caused by the following statement in my
implementation:
win32serviceutil.ServiceFramework.__init__(self, args)
I do not understand where and how the 'args' parameter is being defined.
If I strip the "service" interface (which references the 'args'
parameter) from my class, it seems to work just fine as a COM object.
Could someone offer some suggestions on what I need to do.
Thanks.
More information about the Python-list
mailing list