From: Vadim Zeitlin Date: Mon, 2 Sep 2002 12:39:16 +0000 (+0000) Subject: signed/unsigned comparison warning (and probably even error) fixed X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/478cababc5eb51aa1693357d43f9003ae131ecc6 signed/unsigned comparison warning (and probably even error) fixed git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16932 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index 41af85d6a4..f57a180cac 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -200,13 +200,22 @@ void wxChoice::SetString(int n, const wxString& s) wxString wxChoice::GetString(int n) const { - size_t len = (size_t)::SendMessage(GetHwnd(), CB_GETLBTEXTLEN, n, 0); + int len = (int)::SendMessage(GetHwnd(), CB_GETLBTEXTLEN, n, 0); + wxString str; - if (len != CB_ERR && len > 0) { - if ( ::SendMessage(GetHwnd(), CB_GETLBTEXT, n, - (LPARAM)str.GetWriteBuf(len)) == CB_ERR ) { + if ( len != CB_ERR && len > 0 ) + { + if ( ::SendMessage + ( + GetHwnd(), + CB_GETLBTEXT, + n, + (LPARAM)(wxChar *)wxStringBuffer(str, len) + ) == CB_ERR ) + { wxLogLastError(wxT("SendMessage(CB_GETLBTEXT)")); } + str.UngetWriteBuf(); }