Reputation: 6345
Under what conditions the Win32 call GetMenuItemCount can return -1, except of providing an invalid handle to the menu?
Upvotes: 0
Views: 148
Reputation: 51413
All you can assume is that GetMenuItemCount returns -1 on failure.
Specific reasons why this API call can fail are not documented—i.e., they are not part of the published contract. They are implementation details that can change over time, so your code cannot rely upon them.
If you need to get additional information in the event of a failure, call GetLastError as the documentation advises.
Upvotes: 3