WinXP strange character conversion
-
Private Sub box_Keypress(KeyAscii As Integer) 'if you enter ALT+0176 'then KeyAscii = 176 normaly, but on some WinXP machines 'KeyAscii = -23583 (because character not in range [0,127]). 'Also note that if you try to convert this value to a character, 'you'll get a range error (of course). End Sub Does anyone know why we receive an invalid character code on some WinXP machines and not on others? Why are only characters in the range [0,127] being properly passed to Keypress? Signed: John R. Shaw
-
Private Sub box_Keypress(KeyAscii As Integer) 'if you enter ALT+0176 'then KeyAscii = 176 normaly, but on some WinXP machines 'KeyAscii = -23583 (because character not in range [0,127]). 'Also note that if you try to convert this value to a character, 'you'll get a range error (of course). End Sub Does anyone know why we receive an invalid character code on some WinXP machines and not on others? Why are only characters in the range [0,127] being properly passed to Keypress? Signed: John R. Shaw
-
Private Sub box_Keypress(KeyAscii As Integer) 'if you enter ALT+0176 'then KeyAscii = 176 normaly, but on some WinXP machines 'KeyAscii = -23583 (because character not in range [0,127]). 'Also note that if you try to convert this value to a character, 'you'll get a range error (of course). End Sub Does anyone know why we receive an invalid character code on some WinXP machines and not on others? Why are only characters in the range [0,127] being properly passed to Keypress? Signed: John R. Shaw
Note: UNICODE uses same extended character codes as windows extended codes. The problem only happens in VB code. I think the problem only occurs on WinXP, if more than one language is installed. On Win2000; if you select Chinese (Taiwan): ALT+0176 translated to 162 = '¢'. ALT+0177 translated to 161 = 'í'. ALT+0178 translated to 50 = '2'.