Thomas S.
Thomas S.

Reputation: 6345

GetMenuItemCount returning -1

Under what conditions the Win32 call GetMenuItemCount can return -1, except of providing an invalid handle to the menu?

Upvotes: 0

Views: 148

Answers (1)

IInspectable
IInspectable

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

Related Questions