X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8584b0e64b273273bad122d28b10176bd5a3bc84..96c9640205933ad0673d5af2c96af0816c50160c:/src/msw/listbox.cpp diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 69565096f7..fd17da4b41 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -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)