From: Mattia Barbon Date: Tue, 27 Aug 2002 20:29:55 +0000 (+0000) Subject: Don't get the string when the combobox returned CB_ERR when getting X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/fe5af006f11e5d97bc37bc086521d64db025ea82 Don't get the string when the combobox returned CB_ERR when getting the length. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16826 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index 2f7587a4f3..41af85d6a4 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -202,7 +202,7 @@ wxString wxChoice::GetString(int n) const { size_t len = (size_t)::SendMessage(GetHwnd(), CB_GETLBTEXTLEN, n, 0); wxString str; - if (len) { + if (len != CB_ERR && len > 0) { if ( ::SendMessage(GetHwnd(), CB_GETLBTEXT, n, (LPARAM)str.GetWriteBuf(len)) == CB_ERR ) { wxLogLastError(wxT("SendMessage(CB_GETLBTEXT)"));