X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8584b0e64b273273bad122d28b10176bd5a3bc84..ebefc86eae4e1f8f9c6efa04234bee363aa58b69:/src/msw/listbox.cpp diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 69565096f7..c01c325a5c 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -251,7 +251,7 @@ int wxListBox::FindString(const wxString& s, bool bCase) const 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 @@ -306,7 +306,15 @@ bool wxListBox::IsSelected(int N) const void *wxListBox::DoGetItemClientData(unsigned int n) const { - return (void *)SendMessage(GetHwnd(), LB_GETITEMDATA, n, 0); + LPARAM rc = SendMessage(GetHwnd(), LB_GETITEMDATA, n, 0); + if ( rc == LB_ERR && GetLastError() != ERROR_SUCCESS ) + { + wxLogLastError(wxT("LB_GETITEMDATA")); + + return NULL; + } + + return (void *)rc; } void wxListBox::DoSetItemClientData(unsigned int n, void *clientData) @@ -465,7 +473,7 @@ void wxListBox::SetString(unsigned int n, const wxString& s) 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 )