Code-snippet follows (UNICODE on):
CString myString = "bollocks";
char stoneageBuffer[100];
//initialize your stoneage buffer
memset(stoneageBuffer,0,sizeof(stoneageBuffer));
sprintf(stoneageBuffer,"%S",myString);
//...
//back to CString
myString = stoneageBuffer;
Note that %S (and not %s) formatting type switches to the opposite type of character set (UNICODE if MBCS build and MBCS if UNICODE build).
3 comments:
This may someday give me nightmares.
THANK YOU SO MUCH. I was about to pull my hair out.
75% of C++ programmers are bald? Go figure why ...
Post a Comment