home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,703 of 10,840   
   Steve Gerrard to Mike   
   Re: NewEnum diffeculties   
   24 Oct 05 19:07:47   
   
   From: mynamehere@comcast.net   
      
   "Mike"  wrote in message   
   news:UPydnVlterqDcMHeRVnyuQ@skypoint.com...   
   >I have used the Class Builder in my vb6 project to create a collection class   
   >for my project. Using Class Builder automatically create the NewEnum method   
   for   
   >you, and I've done this a hundred time, and everything is good.   
      
   (big snip)   
      
   >   
   > Why can't I use the NewEnum method with my returned "subset" collection class   
   > ?   
   > Any ideas/opinions ?   
   >   
      
   I will bet $1 that you can't use any For Each ... iterator with your CFiles   
   class, whether the one returned by GetPatternFiles or otherwise.   
      
   While Class Builder does setup the NewEnum for you, it is easy to loose the   
   required setting. It doesn't copy/paste, for instance.   
      
   Assuming you already have   
      
   Public Property Get NewEnum() As IUnknown   
       'this property allows you to enumerate   
       'this collection with the For...Each syntax   
       Set NewEnum = mCol.[_NewEnum]   
   End Property   
      
   Click on the word NewEnum, then click on menu Tools, Procedure Attributes...   
   Make sure NewEnum is the selected method, then click the Advanced button on the   
   form.   
   My $1 bet is that the Procedure ID is not -4. If you make it so, and click OK,   
   you should be able to use For Each.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca