Re: Antonym to _tcsnextc()
- From: "Frank A. Uepping" <trash@xxxxxxxxxxxxxxx>
- Date: Fri, 06 May 2005 21:13:46 +0200
Severian [MVP] schrieb:
On Fri, 06 May 2005 17:22:30 +0200, "Frank A. Uepping" <trash@xxxxxxxxxxxxxxx> wrote:
Hi, does the Win32 API or MFC provide a function doing the reverse of _tcsnextc()?
Thanks FAU
Win32 API: CharPrev().
There does not seem to be a CRT or <tchar.h> equivalent.
Thanks, but this is not what I mean; I was a little imprecise.
I am looking for a function (I will name it _tcsfoo()) that takes the result of _tcsnextc() and returns the string representation for it.
For example:
LPCTSTR c[] = _T("x");
unsigned i = _tcsnextc(c);
if (_tcscmp(_tcsfoo(i), c) == 0)
; // Should be equal.For what do I need this? For example, if you want to printf() a TCHAR.
TCHAR c;
_tprintf(_T("%c\n"), c);This works well for _UNICODE (and for ANSI) applications. But not for _MBCS applications, if c is a lead byte. A solution to this problem could be:
LPCTSTR c[] = _T("x");
unsigned i = _tcsnextc(c);
_tprintf(_T("%s\n"), _tcsfoo(i));This solution should work for ANSI, _UNICODE and _MBCS applications.
Has the Win32 API a solution for this kind of problem?
Thanks FAU
.
- Follow-Ups:
- Re: Antonym to _tcsnextc()
- From: Eugene Gershnik
- Re: Antonym to _tcsnextc()
- References:
- Antonym to _tcsnextc()
- From: Frank A. Uepping
- Re: Antonym to _tcsnextc()
- From: Severian [MVP]
- Antonym to _tcsnextc()
- Prev by Date: Re: cos / sin in filter driver?
- Next by Date: Re: Debugging parent module and child module side by side
- Previous by thread: Re: Antonym to _tcsnextc()
- Next by thread: Re: Antonym to _tcsnextc()
- Index(es):
Relevant Pages
|