On Mon, 15 Jul 2002, Shachar Shemesh wrote:
LPWSTR lpText = (LPWSTR)lParam;
lpText[0] = '\0';
Shouldn't it be
LPWSTR lpText = (LPWSTR)lParam;
lpText[0] = L'\0';
It does not matter. Both are equivalent to:
lpText[0] = 0;
'\0' is a single byte 0 value (IOW a char) which is expanded to 16bits, and assigned to the WCHAR. L'\0' is a 32bit 0 Unicode character (a wchar_t) which is scaled down to 16bits and assigned to the WCHAR. And the last one is a 32bit integer which too is scaled down to 16bits and assigned to the WCHAR.
The thing is Unix C compilers don't have 16bit literal Unicode characters (except in some cases g++ 3.x) so you cannot write code that does not imvolve a conversion of some sort.
-- Francois Gouget fgouget@free.fr http://fgouget.free.fr/ I haven't lost my mind, it's backed up on tape around here somewhere...