win32com support

Crawley crawley.storm.dontsendmeemail at
Sat Jan 31 12:21:37 CET 2004

Thanks for the reply, 

Now I think Ive figured out whats going on. Im getting the following 

Traceback (most recent call last):
  File "E:\Python23\lib\site-packages\win32com\", line 170, 
in dispatch
    retVal = ob._InvokeEx_(meth.dispid, 0, meth.invkind, args, None, 
  File "E:\Python23\lib\site-packages\win32com\server\", line 
322, in _InvokeEx_
    return self._invokeex_(dispid, lcid, wFlags, args, kwargs, 
  File "E:\Python23\lib\site-packages\win32com\server\", line 
601, in _invokeex_
    return DesignatedWrapPolicy._invokeex_( self, dispid, lcid, wFlags, 
args, kwArgs, serviceProvider)
  File "E:\Python23\lib\site-packages\win32com\server\", line 
541, in _invokeex_
    return func(*args)
  File "E:\code\Python\", line 69, in OnConnection
    application.SetAddInInfo(None, self._command, -1, -1, addin )
  File "E:\Python23\lib\site-packages\win32com\client\", line 
460, in __getattr__
    raise AttributeError, "%s.%s" % (self._username_, attr)
exceptions.AttributeError: <unknown>.SetAddInInfo

Which I believe is because the object I'm calling does not support the 
SetAddInInfo method.

After a bit of investigation, this makes sense as my class extends 
_IDTExtensibility2 and for that the application parameter is of type 
'Object'.  I cant see how to cast this into an IApplication instance, 
which is what I need to call my function.

Ive also tried making my object derive from IDSAddin (what VC uses), but 
when I try the following (GUID found 

universal.RegisterInterfaces('{C0002F81-AE2E-11cf-AD07-00A0C9034965}', 0, 
1, 0, ["_IDSAddin"])

I get the following error:

Traceback (most recent call last):
  File "E:\code\Python\", line 33, in ?
00A0C9034965}', 0, 1, 0, ["_IDSAddin"])
  File "E:\Python23\lib\site-packages\win32com\", line 21, in 
    tlb = pythoncom.LoadRegTypeLib(typelibGUID, major, minor, lcid)
pywintypes.com_error: (-2147319779, 'Library not registered.', None, 

Am I using the wrong name ('_IDSAddin') or the wrong GUID or is something 
more major going wrong.

Thanks for your help


More information about the Python-list mailing list