From fe5af006f11e5d97bc37bc086521d64db025ea82 Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Tue, 27 Aug 2002 20:29:55 +0000 Subject: [PATCH] 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 --- src/msw/choice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)")); -- 2.45.2