I am developing a MFC program under windows CE. It is unicode by default. I can use TRACE to print some message like this
TRACE(TEXT("Hey! we got a problem!
"));
It works fine if everything is unicode. But however, I got some ascii string to print. For example:
// open the serial port
m_Context = CreateFile(TEXT("COM1:"), ...);
int rc = ReadFile(m_Context, buffer, 1, cBytes, NULL);
// Oops!! We got a problem, because we can t print a non-unicode string
TRACE(TEXT("Read data: %s
"), buffer);
I read string through com1 from a GPS module. It send text like this "$GPSGGA,1,2,3,4". They are all encoded with ASCII. I want to print them out with TRACE, how can I do?
Thanks.