Re: C++ help needed!(My own solution)
From: Alexander Grigoriev (alegr_at_earthlink.net)
Date: 10/23/04
- Next message: Alexander Grigoriev: "Re: Bug in win xp: Auto-detaching modeless dialog."
- Previous message: Ajay Kalra: "Re: class + class-name ?"
- In reply to: Sergey Kochkarev: "Re: C++ help needed!(My own solution)"
- Next in thread: Joseph M. Newcomer: "Re: C++ help needed!(My own solution)"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 22 Oct 2004 21:23:03 -0700
There are different ways to use UNICODE in ANSI build.
First, you know that UNICODE data is declared as WCHAR in Windows programs.
You can use wchar_t now, though. If you want to pass UNICODE string to a
function, but have TCHAR or CString source, you can use T2W macro (see "ATL
and MFC String Conversion Macros" topic). With VC7, you can use CStringW:
void f(LPCTSTR s)
{
FunctionW(CStringW(s));
}
This will create a temporary UNICODE CString, applying conversion, if
necessary. CT2W macro does about the same (but skips a temporary for UNICODE
build).
You don't quite understand what "scalable" means. LPCTSTR type definitely
doesn't break when the program workload gets greater or the program gets
larger.
"Sergey Kochkarev" <kochkarev@pisem.net> wrote in message
news:c882495.0410212311.1ac08455@posting.google.com...
> "Alexander Grigoriev" <alegr@earthlink.net> wrote in message
> news:<uX$uFF#tEHA.2000@TK2MSFTNGP14.phx.gbl>...
>
> Yeah, you are right - unless someone wants to use unicode and ANSI in
> the same program. Wanna example - here you are. Some newly invented
> interfaces in XP accept unicode strings only - but my program is ANSI
> and will never be unicode. So parts of the program use ANSI, others
> use unicode - to use LPCTSRT would be tricky. Espscially if we have
> good old standard char and wchar. LPCTSTR is just not scalable, it is
> worthless to use it in programs bigger than Hello world.
- Next message: Alexander Grigoriev: "Re: Bug in win xp: Auto-detaching modeless dialog."
- Previous message: Ajay Kalra: "Re: class + class-name ?"
- In reply to: Sergey Kochkarev: "Re: C++ help needed!(My own solution)"
- Next in thread: Joseph M. Newcomer: "Re: C++ help needed!(My own solution)"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|