The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

non-unicode CString in unicode project

I have an MFC app which I have carefully unicode enabled.
But it has to write a couple of legacy formats which are plain ascii - I know that the data only contains regular characters.

1, Is there a magic option to CString to say "this one is not unicode"?

2, Do I have to revert to char[] and sprintf ?

3, Do I just copy every alternate byte from the CString data buffer?
Martin Send private email
Wednesday, April 12, 2006
I believe you can use CStringA when you want to use an ASCII string in a unicode build.  The compiler uses a typedef to switch between it and CStringW based on the UNICODE #define.  You'd not apply the _T macro to any constants you need to use with CStringA.
Doug Send private email
Wednesday, April 12, 2006
Thank you - exactly what I was looking for.
Martin Send private email
Thursday, April 13, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz