_const_ Гость
|
Добавлено: Вт Авг 31 2004 15:06 Заголовок сообщения: Unicode |
|
|
MSDN:
To take advantage of the MFC and C run-time support for Unicode, you need to:
Define _UNICODE.
Define the symbol _UNICODE before you build your program.
Specify entry point.
In the Output category of the Link tab in the Project Settings dialog box, set the Entry Point Symbol to wWinMainCRTStartup.
Use “portable” run-time functions and types.
Use the proper C run-time functions for Unicode string handling. You can use the wcs family of functions, but you may prefer the fully “portable” (internationally enabled) _TCHAR macros. These macros are all prefixed with _tcs; they substitute, one for one, for the str family of functions. These functions are described in detail in the Internationalization section of the Run-Time Library Reference. For more information, see Generic-Text Mappings in TCHAR.H.
Use _TCHAR and the related portable data types described in Support for Unicode.
Handle literal strings properly.
The Visual C++ compiler interprets a literal string coded as
L"this is a literal string"
to mean a string of Unicode characters. You can use the same prefix for literal characters. Use the _T macro to code literal strings generically, so they compile as Unicode strings under Unicode or as ANSI strings (including MBCS) without Unicode. For example, instead of:
pWnd->SetWindowText( “Hello” );
use:
pWnd->SetWindowText( _T(“Hello”) );
With _UNICODE defined, _T translates the literal string to the L-prefixed form; otherwise, _T translates the string without the L prefix.
Tip The _T macro is identical to the _TEXT macro.
Определяй _UNICODE на закладке C/C++ в Project Settings (Preprocessor definitions). |
|