This happens in code which unmaps message, mapped from ASCII to Unicode. See windows/winproc.c, function WINPROC_UnmapMsg32ATo32W:
case WM_GETTEXTLENGTH: case CB_GETLBTEXTLEN: case LB_GETTEXTLEN: /* there may be one DBCS char for each Unicode char */ return result * 2;
What is the correct way to handle double-byte characters in this situation? How Windows handles this? At least can we return double values when system metrics SM_DBCSENABLED is true? We could have a switch in the config file for this system metrics.
I came across this issue when used default combo box control implementation in Delphi 6. I assume the same issue also exists for edit controls. The returned length is correct if I comment out the code above.
Existing behavior is a possible cause of bug in entering serial numbers - when cursor jumps to the next edit field when only half of text is entered.
Thanks, Andriy
__________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com