Python COM iterator

Steve Holden steve at holdenweb.com
Thu Apr 19 14:59:32 EDT 2007


Ross Ridge wrote:
> Larry Bates wrote:
>> I tested in VB and by golly it works!  What is odd is that this looks
>> NOTHING like what we got from the docs earlier.  No GetEnumerator
>> method, no MoveNext method.  I'm glad it works, but I'm a little
>> puzzled as to why it works.
> 
> The documention Carsten Haese referenced earlier was for the .NET version
> of VisualBasic, and shows how to use .NET's IEnumerate and IEnumerable
> interfaces.
>  
> Steve Holden  <steve at holdenweb.com> wrote:
>> Presumably the magic of mark Hammond's wrapper classes providing 
>> adaptation between Python iteration and COM enumerable collection 
>> objects. win32all is *very* Pythonic.
> 
> Maybe Mark Hammond's win32all provides such a magic wrapper, but Cartsen
> Haese's example didn't use it.  Instead it provided it own implementation
> of the COM IEnumVARIANT interface, the OLE Automation (ie. VisualBasic
> 6 compatable) way implementing iteratable objects.
> 
> 					Ross Ridge
> 
So I saw when I read Carsten's reply to my post. Thanks. It's the 
difference between COM and .NET (something I am currently having to come 
to terms with myself, but strangely in C# rather than Python).

regards
  Steve
-- 
Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd          http://www.holdenweb.com
Skype: holdenweb     http://del.icio.us/steve.holden
Recent Ramblings       http://holdenweb.blogspot.com




More information about the Python-list mailing list