Re: Code Page problem in SetWindowText
- From: "Tom Serface" <tom.nospam@xxxxxxxxxxxxx>
- Date: Thu, 6 Sep 2007 08:57:25 -0700
I guess it all depends on what you are going to do with the strings. If you are manipulating them in memory and not using them for any Windows things then certainly ANSI would save memory and time, but it's difficult to quantify the difference and I suspect it is negligible so Unicode seems a better way to go in my opinion. If you really need to minimize memory space (like you're trying to run an MFC application on your watch or something) then perhaps, but ...
Tom
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message news:q90vd3picmebnvab9a3ka6k03i5o08o9c2@xxxxxxxxxx
I've had lots of people insist that it is faster to use ANSI apps because "the strings are
shorter". They don't realize that since all of WIndows is written in Unicode, every ANSI
API has to first convert its arguments to Unicode, then call the Unicode version of the
API, so ANSI would be inherently slower.
In an experiment I ran, Unicode is on the average slightly faster than ANSI, for something
as simple as a repeated SetWindowText, although the variance of the samples is high.
joe
.
- Follow-Ups:
- Re: Code Page problem in SetWindowText
- From: Giovanni Dicanio
- Re: Code Page problem in SetWindowText
- References:
- Code Page problem in SetWindowText
- From: Marco Hung
- Re: Code Page problem in SetWindowText
- From: Mihai N.
- Re: Code Page problem in SetWindowText
- From: Tom Serface
- Re: Code Page problem in SetWindowText
- From: David Ching
- Re: Code Page problem in SetWindowText
- From: Tom Serface
- Re: Code Page problem in SetWindowText
- From: Giovanni Dicanio
- Re: Code Page problem in SetWindowText
- From: Joseph M . Newcomer
- Code Page problem in SetWindowText
- Prev by Date: Re: *fast* change of line color
- Next by Date: Re: Code Page problem in SetWindowText
- Previous by thread: Re: Code Page problem in SetWindowText
- Next by thread: Re: Code Page problem in SetWindowText
- Index(es):
Relevant Pages
|