COM enumeration.
collectionServer1.zip
-
Open the collectionServer project and add enumeration interfaces.
- Open the project and go to the idl file.
- Add a simple object TheCoEnumData with the default
interface IEnumData.
- Populate the IEnumData interface.
- Declare IEnumDataProvider interface and include it
into TheCoCollection.
-
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,
- Include IDispatchImpl template into CTheCoCollection base classes.
- Add COM_ENTERFACE_ENTRY for IEnumDataProvider
- Resolve IDispatch ambiguity with COM_INTERFACE_ENTRY_IID
- Provide C++ definition for the function GetEnumData
-
Provide implementations.
See the zip file: collectionServer1.zip.
-
VBA client application.
The signature of the method Next, while being compliant with EnumXXX standard,
is not VB compatible.