]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listbox.cpp
Enable variadic macros for VC9 and later.
[wxWidgets.git] / src / msw / listbox.cpp
index 69565096f7b90a0fd9dc8c3cea7892829375b4fc..fd17da4b4177f57c1f995954b38b48d646106ec2 100644 (file)
@@ -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)