]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't get the string when the combobox returned CB_ERR when getting
authorMattia Barbon <mbarbon@cpan.org>
Tue, 27 Aug 2002 20:29:55 +0000 (20:29 +0000)
committerMattia Barbon <mbarbon@cpan.org>
Tue, 27 Aug 2002 20:29:55 +0000 (20:29 +0000)
the length.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16826 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/choice.cpp

index 2f7587a4f30636f60ef83a1cad045acdb1477332..41af85d6a400685d793e7db25b9237580dbf3891 100644 (file)
@@ -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)"));