Click to See Complete Forum and Search --> : Changing Strings to work for Unicode


slowcoder
June 30th, 2006, 09:35 AM
I have to change the properties of my project to use Unicode Character Set, and I recieve some errors. I was told that I need to change my strings to be compatiable with Unicode, but I'm not sure how. Here's one example of what I need to change:

ResultPtr += _stprintf(ResultPtr, "In ResultHandler(%d) @ %f seconds\n", Handle, GetSeconds() - StartTick);

and:

ResultPtr += _stprintf(ResultPtr, "Symbology = 0x%08x\nModifier = %c\nLength = %d\nString =\n", Symbology, Modifier, Length);

The person said that it was something simple, but they just couldn't remember either. Any help is appreciated.

Thanks

wildfrog
June 30th, 2006, 10:05 AM
Maybe this helps:
ResultPtr += _stprintf(ResultPtr, _T("In ResultHandler(%d) @ %f seconds\n"), Handle, GetSeconds() - StartTick);
And then ResultPtr should be of type TCHAR*.

- petter

slowcoder
June 30th, 2006, 11:25 AM
Yes, thank you...but I changed ResultPtr to type TCHAR and it worked.

wildfrog
June 30th, 2006, 11:34 AM
Yes, thank you...but I changed ResultPtr to type TCHAR and it worked.First argument (destination buffer) should be a TCHAR* not a TCHAR... :confused:

- petter