RE: [Dev-C++] Make switch condition an enum
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2002-10-19 19:03:37
|
Guess the definition of _T("x")...
#if defined(_UNICODE) || defined(UNICODE)
#define _T(x) L##x
#else
#define _T(x) x
#endif
This is the OFFICIAL way of writing portable MFC or wxWindows programs.
The L"Hello world" concept requires you to change a huge number of strings
whenever you want to activate/deactivate unicode support.
As you can probably guess, all functions taking a string as a parameter
must also be specially handled.
// Microsoft
#if defined(_UNICODE) || defined(UNICODE)
#define _tcslen wcslen
#else
#define _tcslen strlen
#endif
// wxWindows
size_t wxStrlen(const wxChar *s);
/Per W
On Sat, 19 Oct 2002, Ioannis Vranos wrote:
> > -----Original Message-----
> > From: Per Westermark [mailto:pw...@ia...]
> > Sent: Saturday, October 19, 2002 2:26 PM
> > To: Ioannis Vranos
> > Cc: dev...@li...
> > Subject: RE: [Dev-C++] Make switch condition an enum
> >
> >
> > The _T(x) is a macro used by a Microsoft Developer Studio,
> > the wxWindows
> > framework etc, to handle wide/non-wide, characters. All you
> > have to do is
> > to #define _UNICODE (or sometimes #define UNICODE, or in wxWindows
> > #define wxUSE_UNICODE 1) to switch all "tagged"
> > strings to wide character strings.
>
>
> I do not know Win32 API-specific stuff but concerning ANSI C and ANSI
> C++ you can define a string literal as a wide character one by placing
> the capital letter L in front of it. For example consider the C90
> program:
>
>
> #include <stdio.h>
> #include <stddef.h>
>
> int main()
> {
> const wchar_t *ws=L"Wide character string";
>
> wprintf(L"%s\n", ws);
>
> return 0;
> }
>
>
> Ioannis
>
> * Ioannis Vranos
> * Programming pages: http://www.noicys.freeurl.com
> * Alternative URL: http://run.to/noicys
>
>
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:
> Access Your PC Securely with GoToMyPC. Try Free Now
> https://www.gotomypc.com/s/OSND/DD
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|