Try receiving the messages in a buffer of type unsigned char[]: a char ranges from -127 to 128 while an unsigned char is 0 to 255. The same bit patter in the two cases represents different numeric values.
Try executing these lines in the interactive window:
unsigned char b[10];
char a[10];
strcpy (a, "Hello!"); a[3] = 241;
strcpy (b, a);
DebugPrintf ("String A: %s - a[3] = %x (%d)\n", a, a[3], a[3]);
DebugPrintf ("String B: %s - b[3] = %x (%d)\n", b, b[3], b[3]);
Output will be:
String A: Helño! - a[3] = fffffff1 (-15)
String B: Helño! - b[3] = f1 (241)
Hope this helps
Roberto
Message Edited by Roberto Bozzolo on 05-20-2005 06:53 PM