What does Windows error code 1433 (ERROR_SETCOUNT_ON_BAD_LB) mean?

 
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 CreateWindowEx call.
  • Use normal LB_ADDSTRING/LB_INSERTSTRING population for data-storing list boxes.
  • For huge virtual lists, create the control with LBS_NODATA and implement owner-draw data retrieval correctly.
  • Do not use LB_SETCOUNT merely 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.