Delegating a Collection

The Collection class creates a helper class that implements the IEnumVARIANT interface. To create your own collection, put the data into a real Collection inside your class and make it available to the world as if it were yours. This technique was available in Visual Basic version 4, but only in an indirect, unsafe way that threw encapsulation to the winds. Version 5 fixes those problems, but it does so in a way that…well, judge for yourself.