[IronPython] PreferComDispatch - Odd Behaviour

Davy Mitchell daftspaniel at gmail.com
Sun Apr 13 08:53:26 CEST 2008


IP2.0.0.1000
from System import Type, Activator
wb = Activator.CreateInstance(Type.GetTypeFromProgID("WScript.Shell"))
print dir(wb)
print wb.CurrentDirectory()
print wb.SpecialFolders("Desktop")
print dir(wb)

The first dir of wb is missing a method which appears as soon as a call is
made to it.
Interestingly CurrentDirectory is listed in the first dir without being
called.

['CreateObjRef', 'CurrentDirectory', 'Equals', 'Exec', 'Finalize',
'GetAttrNames
', 'GetHashCode', 'GetLifetimeService', 'GetMemberNames', 'GetType',
'Initialize
LifetimeService', 'MemberwiseClone', 'ReferenceEquals', 'ToString',
'__class__',
 '__delattr__', '__doc__', '__getattribute__', '__hash__', '__init__',
'__new__'
, '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__']
c:\code\comtry
c:\users\daftspaniel\desktop
['CreateObjRef', 'CurrentDirectory', 'Equals', 'Exec', 'Finalize',
'GetAttrNames
', 'GetHashCode', 'GetLifetimeService', 'GetMemberNames', 'GetType',
'Initialize
LifetimeService', 'MemberwiseClone', 'ReferenceEquals', '*SpecialFolders*',
'ToStr
ing', '__class__', '__delattr__', '__doc__', '__getattribute__', '__hash__',
'__
init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__',
'__setattr__', '_
_str__']

Thanks,
Davy Mitchell

-- 
Davy Mitchell
Blog - http://www.latedecember.co.uk/sites/personal/davy/
Twitter - http://twitter.com/daftspaniel
Skype - daftspaniel http://needgod.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20080413/66e9fe56/attachment.html>


More information about the Ironpython-users mailing list