| Previous | Next |
| ERROR_INVALID_LB_MESSAGE | ERROR_LB_WITHOUT_TABSTOPS |
ERROR_SETCOUNT_ON_BAD_LB
LB_SETCOUNT requires an LBS_NODATA list box
LB_SETCOUNT sets the item count of a list box created with the LBS_NODATA style. Such a control is used for very large item sets where the list box does not store ordinary strings for every item.
Sending the message to a conventional list box is a mismatch between the storage model chosen at creation and the message used later. Adding LBS_OWNERDRAWFIXED alone is not enough; Microsoft documents LBS_NODATA as the relevant requirement.
What to check
- Inspect the list-box style in the resource or
CreateWindowExcall. - Use normal
LB_ADDSTRING/LB_INSERTSTRINGpopulation for data-storing list boxes. - For huge virtual lists, create the control with
LBS_NODATAand implement owner-draw data retrieval correctly. - Do not use
LB_SETCOUNTmerely as a shortcut to preallocate ordinary items.
The failure is not an out-of-range count; the list-box type itself does not support this message.
References
Looking for a different code? Search another status or error code.
