Re: How to LPCTSTR Convert to char *
- From: "Tom Serface" <tserface@xxxxxxx>
- Date: Wed, 6 Dec 2006 13:14:18 -0800
I agree with Ajay... I would just change it to an ANSI project by turning
Unicode off in the Project Properties. That will be the easiest solution
since you have no internationalization needs.
Tom
"r norman" <r_s_norman@xxxxxxxxxxxx> wrote in message
news:4e4en21dq26inbns39jaeq5ngk7ekvborc@xxxxxxxxxx
On Wed, 06 Dec 2006 13:12:20 -0500, Joseph M. Newcomer
<newcomer@xxxxxxxxxxxx> wrote:
An LPCTSTR is a const TCHAR *, so do you mean you want to remove the const
attribute, or
you really want a 'char *' data type (remember that char and char*
represent an obsolete
technology that should be used only in very rare and exotic situations
where you are
absolutely guarnteed because of external specs to be using 8-bit
characters, and should
never be coded as a matter of course in any program).
If you really want a 'char *', that is, a pointer to an 8-bit character
string, then you
have to explain why you need it and how you plan to handle the
down-conversion from
Unicode characters that have no 8-bit equivalents.
There are those of us who must interface with external hardware in
which the communication interface specifies ASCII character set
messages. For us, creating char[] messages and filling specific
fields with char strings is quite essential. I was enormously taken
aback by switching to the latest Visual Studio and finding all my
strings defaulting to Unicode. So far my applications do not need
internationalization and I am working hard to separate strings used
for user interface from strings used for device communications, though
they are closely inter-related. Still, legacy code including pieces
dating back to DOS days, makes for hard work which is hard to get
somebody to pay for since it does not produce visible enhancements to
performance or add features.
.
- Follow-Ups:
- Re: How to LPCTSTR Convert to char *
- From: Joseph M . Newcomer
- Re: How to LPCTSTR Convert to char *
- From: r norman
- Re: How to LPCTSTR Convert to char *
- References:
- How to LPCTSTR Convert to char *
- From: rxgmoral
- Re: How to LPCTSTR Convert to char *
- From: Joseph M . Newcomer
- Re: How to LPCTSTR Convert to char *
- From: r norman
- How to LPCTSTR Convert to char *
- Prev by Date: Re: Adding plain text into CRichEditCtrl programmatically
- Next by Date: Re: How to LPCTSTR Convert to char *
- Previous by thread: Re: How to LPCTSTR Convert to char *
- Next by thread: Re: How to LPCTSTR Convert to char *
- Index(es):
Relevant Pages
|