if (bCase)
return wxItemContainerImmutable::FindString( s, bCase );
- int pos = ListBox_FindStringExact(GetHwnd(), -1, s.wx_str());
+ int pos = ListBox_FindStringExact(GetHwnd(), -1, s.t_str());
if (pos == LB_ERR)
return wxNOT_FOUND;
else
void *wxListBox::DoGetItemClientData(unsigned int n) const
{
- wxCHECK_MSG( IsValid(n), NULL,
- wxT("invalid index in wxListBox::GetClientData") );
+ LPARAM rc = SendMessage(GetHwnd(), LB_GETITEMDATA, n, 0);
+ if ( rc == LB_ERR && GetLastError() != ERROR_SUCCESS )
+ {
+ wxLogLastError(wxT("LB_GETITEMDATA"));
+
+ return NULL;
+ }
- return (void *)SendMessage(GetHwnd(), LB_GETITEMDATA, n, 0);
+ return (void *)rc;
}
void wxListBox::DoSetItemClientData(unsigned int n, void *clientData)
{
- wxCHECK_RET( IsValid(n),
- wxT("invalid index in wxListBox::SetClientData") );
-
if ( ListBox_SetItemData(GetHwnd(), n, clientData) == LB_ERR )
{
wxLogDebug(wxT("LB_SETITEMDATA failed"));
if ( n == (m_noItems - 1) )
newN = -1;
- ListBox_InsertString(GetHwnd(), newN, s.wx_str());
+ ListBox_InsertString(GetHwnd(), newN, s.t_str());
// restore the client data
if ( oldData )