win32com support

Mark Hammond mhammond at skippinet.com.au
Sat Jan 31 17:15:54 EST 2004


Crawley wrote:
>   File "E:\Python23\lib\site-packages\win32com\client\dynamic.py", 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.

For some reason, the object you are using does not have makepy support, 
which is unusual.

> 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.

Generally, you can do a QueryInterface for the object.  However, if the 
object does not support IDispatch, you will haver trouble - we don't 
support arbitrary interfaces when calling them, only implementing them.


ob = ob._obj_.QueryInterface(

> Ive also tried making my object derive from IDSAddin (what VC uses), but 
> when I try the following (GUID found 
> here:http://msdn.microsoft.com/library/default.asp?url=/library/en-
> us/vcug98/html/_asug_how_add.2d.ins_connect_and_disconnect.asp)
> 
> universal.RegisterInterfaces('{C0002F81-AE2E-11cf-AD07-00A0C9034965}', 0, 
> 1, 0, ["_IDSAddin"])
> 
> I get the following error:

The GUID must be for a type library.  If you run "makepy.py -i", then 
you will get a list of all valid typelibs you can use, and the params 
for it.

Mark.




More information about the Python-list mailing list