Gerard Patel gerard.patel@nerim.net writes:
I don't understand it :
case WM_GETTEXTLENGTH: 719 case CB_GETLBTEXTLEN: 720 case LB_GETTEXTLEN: 721 /* there may be one DBCS char for each Unicode char */ 722 return result * 2;
This has a bad effect on one of my test apps - returns a length of 12 for a text of 6 characters, displays funny symbols after the text.
The Unicode window proc returns 6, why the unicode/ascii conversion should make it 12 ? The Api returns number of chars, not bytes.
The idea is that 6 Unicode chars can yield more than 6 ASCII chars with DBCS text. The MSDN doc states that WM_GETTEXTLENGTH can return more than the actual size when mixing ASCII and Unicode.
What does the app do exactly? Maybe there are cases where the conversion can be avoided.