Code Comments
Programming Forum and web based access to our favorite programming groups.Is it possible to create a custom enumerator object in VB6? I am building a quite complex container object that in general behaves like a very intelligent collection. I would "like" to be able to use For-Each outside of the object to enumerate internal items. However, the enumeration logic for this particular container is much more complex than a normal collection. So I would like to create a custom enumerator to handle the movenext, etc. methods like you can in other language implementations. Something like: Public Property Get NewEnum() as IUnknown .. Set NewEnum = MyCustomEnumerator End Property Thanks, Gerald
Post Follow-up to this messageOn Tue, 28 Sep 2004 09:53:56 -0600, "Gerald Hernandez" <Cablewizard@spam_remove@Yahoo.com> wrote: >Is it possible to create a custom enumerator object in VB6? >I am building a quite complex container object that in general behaves like >a very intelligent collection. I would "like" to be able to use For-Each >outside of the object to enumerate internal items. However, the enumeration >logic for this particular container is much more complex than a normal >collection. So I would like to create a custom enumerator to handle the >movenext, etc. methods like you can in other language implementations. >Something like: > >Public Property Get NewEnum() as IUnknown > ... > Set NewEnum = MyCustomEnumerator >End Property > >Thanks, >Gerald Have a look at the CSuperCollection example in the Collections section at http://www.mvps.org/vbvision/ HTH, Bryan ________________________________________ ____________________ New Vision Software "When the going gets weird," Bryan Stafford "the weird turn pro." alpine_don'tsendspam@mvps.org Hunter S. Thompson - Microsoft MVP-Visual Basic Fear and Loathing in LasVegas
Post Follow-up to this messagePerfect! Exactly what I was looking for. Thank you, Gerald "alpine" <alpine_don'tsendspam@mvps.org> wrote in message news:7v3jl0hctmbbv4en29h76lkg9or6kvjq2g@ 4ax.com... > On Tue, 28 Sep 2004 09:53:56 -0600, "Gerald Hernandez" > <Cablewizard@spam_remove@Yahoo.com> wrote: > like enumeration > > > Have a look at the CSuperCollection example in the Collections section > at http://www.mvps.org/vbvision/ > > HTH, > Bryan > ________________________________________ ____________________ > New Vision Software "When the going gets weird," > Bryan Stafford "the weird turn pro." > alpine_don'tsendspam@mvps.org Hunter S. Thompson - > Microsoft MVP-Visual Basic Fear and Loathing in LasVegas
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.