airek
asked on
Binary data with MSComm control in VC++
I need to recieve binary data with an MSComm communications control in VC++ 6.0 with MFC. I know that in VB you can set the InputMode property to binary but I can't find any way to do this in C. The problem is that my data contains bytes with the value zero and input is a string so a zero byte terminates the string.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Then you can, for example, print the string contents as hex data:
for(i=0;i<nStringLength;i+
printf("%02X, ",(int) String[i]);
But you cannot use such string in
printf("%s",String)
because only initial part of the string, terminated by zero, will be printed.