Re: How to LPCTSTR Convert to char *



It depends on what you mean by the question.

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.
joe

On Tue, 5 Dec 2006 20:20:31 -0600, rxgmoral <rxgmoral.2idl9p@xxxxxxxxxxxxxxxxxxxxx> wrote:


How to LPCTSTR Convert to char *

thank :)
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.



Relevant Pages

  • Re: new ...delete not working
    ... nothing wrong with using CHAR in such software. ... >>MyConnect (LPCTSTR myuser, LPCTSTR mypwd) ... although the delusion that 8-bit characters still make ... > your responsibility to convert Unicode to 8-bit if necessary. ...
    (microsoft.public.vc.mfc)
  • Re: heeeeeeeeeeeeeeeellllllllllllllppppppppppppppppppppp
    ... Why is using char* a bad thing and why using sprintf a bad thing to, ... can be up to MAX_PATH characters). ... LPSTR lpMsgBuf; ... MessageBox(NULL, lpMsgBuf, "GetLastError() for ...
    (microsoft.public.vc.mfc)
  • Re: heeeeeeeeeeeeeeeellllllllllllllppppppppppppppppppppp
    ... This means that if you develop the bad habit of using char * (left over ... It usually takes me five minutes to create a Unicode version of any of my apps, ... BOOL and bool are different data types. ... can be up to MAX_PATH characters). ...
    (microsoft.public.vc.mfc)
  • Re: Char and Varchar
    ... If the maximum length is short (<= 10 characters), ... maximum length, I also use CHAR. ... I use VARCHAR if long and short ...
    (microsoft.public.sqlserver.server)
  • Re: Char and Varchar
    ... If the maximum length is short (<= 10 characters), ... maximum length, I also use CHAR. ... I use VARCHAR if long and short ...
    (microsoft.public.sqlserver.programming)

Loading