From 72d827010cfeef63dc6f59e3e17a2a65d3e30060 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Wed, 10 Jul 2002 23:11:28 +0000 Subject: [PATCH] CBUpdateEdit: LB_GETTEXTLEN returns LB_ERR on error, not 0. --- controls/combo.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/controls/combo.c b/controls/combo.c index 49215e72613..e92a2a70c14 100644 --- a/controls/combo.c +++ b/controls/combo.c @@ -771,6 +771,8 @@ static void CBPaintText( if( (id = SendMessageW(lphc->hWndLBox, LB_GETCURSEL, 0, 0) ) != LB_ERR ) { size = SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, id, 0); + if (size == LB_ERR) + FIXME("LB_ERR probably not handled yet\n"); if( (pText = HeapAlloc( GetProcessHeap(), 0, (size + 1) * sizeof(WCHAR))) ) { /* size from LB_GETTEXTLEN may be too large, from LB_GETTEXT is accurate */ @@ -1113,7 +1115,7 @@ static void CBUpdateEdit( LPHEADCOMBO lphc , INT index ) if( index >= 0 ) /* got an entry */ { length = SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, (WPARAM)index, 0); - if( length ) + if( length != LB_ERR) { if( (pText = HeapAlloc( GetProcessHeap(), 0, (length + 1) * sizeof(WCHAR))) ) { @@ -1538,7 +1540,8 @@ static LRESULT COMBO_GetText( LPHEADCOMBO lphc, INT N, LPARAM lParam, BOOL unico INT n = 0; INT length = SendMessageW(lphc->hWndLBox, LB_GETTEXTLEN, (WPARAM)idx, 0 ); - + if(length == LB_ERR) + FIXME("LB_ERR probably not handled yet\n"); if(unicode) { LPWSTR lpBuffer, lpText = (LPWSTR)lParam;