COM enumeration.

collectionServer1.zip
  1. Open the collectionServer project and add enumeration interfaces.

    1. Open the project and go to the idl file.
    2. Add a simple object TheCoEnumData with the default interface IEnumData.
    3. Populate the IEnumData interface.
    4. Declare IEnumDataProvider interface and include it into TheCoCollection.

  2. Provide matching C++ definitions.

    Most of the definitions are lready there if you used wizards. However, for the last step, IEnumDataProvider, there is no wizard. Hence,
    1. Include IDispatchImpl template into CTheCoCollection base classes.
    2. Add COM_ENTERFACE_ENTRY for IEnumDataProvider
    3. Resolve IDispatch ambiguity with COM_INTERFACE_ENTRY_IID
    4. Provide C++ definition for the function GetEnumData

  3. Provide implementations.

    See the zip file: collectionServer1.zip.


  4. VBA client application.

    The signature of the method Next, while being compliant with EnumXXX standard, is not VB compatible.

Hosted by www.Geocities.ws

1