IEnumXXX
COM enumerators implement Reset(), Next(), Skip() and Clone(). Here’s the client side:
ATL has a number of classes to support enumeration on the server side. To create a collection that can be consumed like in the code above, CComEnum and CComEnumImpl are classes of interest.
ATL also has support for loading a COM collection into a C++ STL vector, e.g. std:vector<IThing*>, which is kind of a neat trick. See CComEnumOnSTL and IEnumOnSTLImpl
References
- IEnumVARIANT (oaidl.h) - Win32 apps | Microsoft Learn
- IEnumConnectionPoints (ocidl.h) - Win32 apps | Microsoft Learn
- IEnumFORMATETC (objidl.h) - Win32 apps | Microsoft Learn
- IEnumGUID (comcat.h) - Win32 apps | Microsoft Learn
- IEnumMoniker (objidl.h) - Win32 apps | Microsoft Learn
- CComEnum Class | Microsoft Learn
- CComEnumImpl Class | Microsoft Learn
- CComEnumOnSTL Class | Microsoft Learn
- IEnumOnSTLImpl Class | Microsoft Learn