[IronPython] RE: Problems in Automating IE with IronPython

Martin Maly Martin.Maly at microsoft.com
Fri Sep 23 18:05:25 CEST 2005


IronPython caches COM interfaces it comes across and when the COM object
at hand implements interface that is not in the cache, IP calls method
to convert the COM interface into .NET metadata and that takes a long
time.
Now that you are using the tlbimp-ed version, the interfaces make it to
the cache and therefore you see the speed-up.

I am glad it works for you now.

Martin

> -----Original Message-----
> From: users-ironpython.com-bounces at lists.ironpython.com 
> [mailto:users-ironpython.com-bounces at lists.ironpython.com] On 
> Behalf Of Ray Djajadinata
> Sent: Friday, September 23, 2005 12:10 AM
> To: users-ironpython.com at lists.ironpython.com
> Subject: [IronPython] RE: Problems in Automating IE with IronPython
> 
> Please ignore my earlier post about this, I kinda know what 
> caused the problem now. It seems that when I say
> this:
> 
> doc = ieApp.Document
> 
> IP goes and searches for the type of this thing in the type 
> library--so it didn't really hang, it just took a long time 
> for it to find it and return, seemingly. 
> 
> After I've tlbimp-ed mshtml.tlb and loaded the resulting 
> assembly, the call returns immediately. 
> 
> >>> ieApp.Navigate("http://www.yahoo.com/")
> (<System.Reflection.Missing object at
> 0x000000000000002B>, <System.Reflection.Mi
> ssing object at 0x000000000000002B>,
> <System.Reflection.Missing object at 0x0000
> 00000000002B>, <System.Reflection.Missing object at
> 0x000000000000002B>)
> >>> doc = ieApp.Document
> >>> doc
> <com_object System.__ComObject with interfaces [<type 
> 'MSHTML.OldHTMLDocument'>]
> >
> >>>
> 
> Thanks,
> Ray



More information about the Ironpython-users mailing list