title: How to create a VB6 collection object with ATL
body: <p>or a VB6 - compatible - collection object.</p>
  
  <p>We provide hooks into our .net products through a set of API's.</p>
  
  <p>We need to continue to support customers that call our API's from VB6, so we need to continue supporting VB6 collection objects (simple with VBA.Collection in .net).</p>
  
  <p>The problem is supporting some sites that use VBScript to call our API's. VBScript has no concept of a collection object, so to create a collection object to pass to our API we built a VB6 ActiveX DLL that provides a "CreateCollection" method. This method simply creates and passes back a new collection object. Problem solved.</p>
  
  <p>After many years of pruning, porting and re-building, this DLL is the only VB6 code we have. Because of it we still need to install Visual Studio 6 on our Dev &amp; build Machines.</p>
  
  <p>I'm not happy with our reliance on this DLL for several reasons (my personal dislike of VB6 is not one of them). Top of the list is that Microsoft no longer support Visual Studio 6.</p>
  
  <p>My question is, how do I get ATL to create a collection object that implements the same interface as the VB6 collection object.</p>
  
  <p>I've a good handle on C++, but only a loose grasp of ATL - I can create simple objects and implement simple methods, but this is beyond me.</p>