Votre conversion en CharLower déclenche cette erreur. Avant cela, vous devez définir l'octet de poids fort du pointeur transmis à CharLower est égal à ZERO.
De référence MSDN sur la fonction:
If the operand is a character string, the function returns a pointer to the converted string. Because the string is converted in place, the return value is equal to lpsz.
If the operand is a single character, the return value is a 32-bit value whose high-order word is zero, and low-order word contains the converted character.
Quelque chose comme cela pourrait fonctionner:
#define ltolower(ch) CharLower(0x00ff & ch)
Si vous utilisez un compilateur C++, vous pourriez aussi avoir besoin d'un opérateur CAST:
#define ltolower(ch) CharLower((LPTSTR)(0x00ff & ch))
Ne l'avez pas testé si ...
qui ne fonctionnait pas exactement. Mais merci pour l'explication. Je vais juste réécrire le code en utilisant tolower() – Naveen
Je pouvais juste faire:
– Naveen