Share via

IEnumExplorerCommand::Next return values

Kai 6 Reputation points
2022-03-19T23:46:15.677+00:00

Hello,

I want to implement the IEnumExplorerCommand interface to provide a custom entry in the explorer context menu.
Sccording to the documentation IEnumExplorerCommand::Next returns S_OK if the method returns, regardless of whether the specified number of elements could be fetched or not.
Other IEnum*::Next methods return S_OK only if the full count of requested items are successfully retrieved, and S_FALSE if more items were requested than remained in the enumeration.
Shouldn't this also be the case for IEnumExplorerCommand ?

Windows development | Windows API - Win32

1 answer

Sort by: Most helpful
  1. RLWA32 52,571 Reputation points
    2022-03-20T08:56:54.24+00:00

    Although it is a common pattern for an enumerator to return S_FALSE it is not a requirement. There are other instances besides IEnumExplorerCommand (e.g., IEnumAssocHandlers, IEnumResources) that are documented to deviate from the pattern.

    Was this answer helpful?

    2 people found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.