Ok I fell kinda dumb asking thisbut here goes.
back in vb 6 to make a collection of objects I would just
now I looked at Implementing ICollection and a Hashtable and a Storedlist and well it makes since but I don't ( I feel slow because I bet it works the same) see any example of throwing an object into the collection just use numbers or what not...Code:Dim cObjs As Collection cObjs.Add(mObj)
here is why I feel dumb by the way I wrote this reusable collection class about 2 months ago when I was making some COM object or another and wll I thought I had collections down pat....
it doesn't support remove but i didn't need remove
it's for implementing stuff like
Code:class.objs(1).doSomething class.objs(1).objs.doSomethingso anyway i feel dumb please explain it to me....Code:Option Explicit Private mObjs As New Collection Friend Function Add(ByRef obj As Variant, Optional iName As String = "Internal Name") Dim sName As String If iName = "Internal Name" Then sName = mObjs.Count + 1 Else sName = iName End If mObjs.Add obj, sName End Function Public Function NewEnum() As IUnknown Set NewEnum = mObjs.[_NewEnum] End Function Public Property Get Count() As Integer Count = mObjs.Count End Property Public Property Get Child(ByVal Index As Variant) As Variant Set Child = mObjs(Index) End Property




but here goes.
Reply With Quote