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
This commit is contained in:
Mattia Barbon
2002-08-27 20:29:55 +00:00
parent edc973b174
commit fe5af006f1

View 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)"));