How to Use CUnicodeString
  Home FAQ Contact Sign in
microsoft.public.vc.mfc only
 
Advanced search
POPULAR GROUPS

more...

microsoft.public.vc.mfc Profile…
 Up
How to Use CUnicodeString         


Author: Trups
Date: Jun 13, 2008 04:19

Hi,

I want to use CUnicodeString in my code. I am not getting correct
information about it on web.
I need to what are the header files I need to include to use
CUnicodeString. If somebody can give small code snippet I will
appreciate it.

I have created win32 application without using MFC

Thanks
TS
3 Comments
Re: How to Use CUnicodeString         


Author: Tom Serface
Date: Jun 13, 2008 06:17

I don't know much about CUnicodeString (saw the article on CodeProject, but
it doesn't describe much). It seems to me like it would be easier to just
use CString. You don't need the rest of MFC to do that.

I've never had a reason to write a program without MFC, but I think you can
just include:

#include

To use CStringW in your project.

Of course, it would be much easier to just use MFC and you'd expect a guy in
the MFC forum to suggest that :o)

All that said, it looks to me like you just add UnicodeString.cpp to your
project and include UnicodeString.h where you want to use it.

Tom
Show full article (1.08Kb)
no comments
Re: How to Use CUnicodeString         


Author: Joseph M. Newcomer
Date: Jun 13, 2008 07:55

What is the value of CUnicodeString over CStringW? Or, if you are compiling for Unicode,
just CString?
joe

On Fri, 13 Jun 2008 04:19:54 -0700 (PDT), Trups gmail.com> wrote:
Show full article (0.65Kb)
no comments
Re: How to Use CUnicodeString         


Author: David Webber
Date: Jun 13, 2008 23:58

"Joseph M. Newcomer" flounder.com> wrote in message
news:8i2554d5mpbhu7moa9qpv9jthjt87gqcgo@4ax.com...
> What is the value of CUnicodeString over CStringW? Or, if you are
> compiling for Unicode,
> just CString?

Looking at CodeGuru, CUnicodeString dates from 2000, which I suspect was
before CStringW and CStringA could do a lot of the stuff they do now (like
converting between the default code page and unicode). So its raison d'etre
seems to have been largely overtaken.

However there is one real pain in the neck with CString and friends: the one
you get from ATL is a different object from the one you get from MFC. So
try to pass them between MFC and non-MFC DLLs, and disatster unfolds
:-( This seems to be a serious design flaw with the way they have made
CString "independent of MFC".

That in itself may one reason for using CUnicodeString [and in fact I am
going on using my own CStringW and CStringA clones rather than deriving my
(even more capable) strings from the standard ones].
Show full article (1.19Kb)
no comments