I'm trying to implement an iterator over the IEnumString interface. I am having a hard time figuring out the precise contract of the IEnumString::Next() method.
The second parameter is documented as follows:
rgeltAn array of enumerated items.
The enumerator is responsible for allocating any memory, and the caller is responsible for freeing it.
The part that confuses me is how to properly manage memory. Apparently, the IEnumString implementation allocates memory that the caller is requested to free. That seems to imply that the OLESTR*'s received point to memory whose ownership has been transferred to the caller.
Is this how the documentation is to be interpreted? If so, which allocator should be used to free the memory?