Listing 4

// handler for the CB_GETLBTEXT event - just in case you subclass a combobox.
handle_event on_text_at_idx(wm::cb::item_text::arg a, result r) {
  // a.idx - the index for which to retrieve the text
  // a.buff- destination of the buffer
  // r     - will contain the number of characters copied into the buffer
  int chars_len = ...; // no. of chars
  r = chars_len; 
  return event_ex<wm::cb::item_text>().HANDLED_BY(&me::on_text_at_idx);
}