Listing 5 Listbox_front_inserter defined
struct listbox_front_inserter { public: ws_explicit_k listbox_front_inserter(HWND hwndListbox) : m_hwndListbox(hwndListbox) {} #ifdef __STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION template <ws_typename_param_k T> void operator ()(T &t) { insert(s); } #else void operator ()(ws_char_a_t const *s) { insert(s); } void operator ()(ws_char_w_t const *s) { insert(s); } #endif // __STLSOFT_CF_MEMBER_TEMPLATE_FUNCTION // Implementation protected: void insert(ws_char_a_t const *s) { ::SendMessage(m_hwndListbox, LB_INSERTSTRING, 0, reinterpret_cast<LPARAM>(s)); } void insert(ws_char_w_t const *s) { ::SendMessage(m_hwndListbox, LB_INSERTSTRING, 0, reinterpret_cast<LPARAM>(s)); } protected: HWND m_hwndListbox; };