На главную Наши проекты:
Журнал   ·   Discuz!ML   ·   Wiki   ·   DRKB   ·   Помощь проекту
ПРАВИЛА FAQ Помощь Участники Календарь Избранное RSS
msm.ru
! Правила раздела Visual C++ / MFC / WTL (далее Раздела)
1) На Раздел распространяются все Правила Форума.
2) Перед тем, как создать новый топик, убедитесь, что Вы читали Правила создания тем в Разделе.
3) Вопросы, не связанные с программированием (настройки MS Visual Studio, книги, библиотеки и т.д.),
обсуждаются в разделе C/C++: Прочее
4) Вопросы разработки .NET (Windows Form, C++/CLI и т.п.) приложений на Visual C++/C# обсуждаются в разделе .NET.
5) Нарушение Правил может повлечь наказание со стороны модераторов.

Полезные ссылки:
user posted image FAQ Раздела user posted image Обновления для FAQ Раздела user posted image Поиск по Разделу user posted image MSDN Library Online
Модераторы: ElcnU
  
> How to get unicode characters from CRichEditCtrl?
    Hi,

    I have CRichEditCtrl and I write text with different languages there. How could I get unicode characters right? Currently I get only question marks in place of them ("?"). My project uses _MBCS..

    PLEASE help,
    Oxy
      Цитата
      In Rich Edit 2.0, if you create a Unicode rich edit control (one that expects Unicode text messages), you must specify only Unicode data in any window messages sent to the control. Similarly, if you create an ANSI rich edit control, send only ANSI or DBCS data. You can use the IsWindowUnicode function to determine whether a rich edit control uses Unicode text messages. Note that the rich edit COM interfaces use Unicode text unless they encounter a code page argument.

      Выводы: проверь, окно RichEdit у тебя IsWindowUnicode()? Ты используешь 2.0 или 3.0 версию? И вообще, в MSDN много написано про поддержу Unicode, всё должно работать.
      Сообщение отредактировано: Codemaster -
        Thanks for reply.

        IsWindowUnicode() returns true;

        But when you mentioned, I realized that I use standard rich edit control that comes with VC++ 6.0. Then I tried 2nd version, even "MS Rich Text Box Control 6.0", but still no luck.
        Now I end up with _UNICODE definition AND CEdit class :) wich returns real characters (not "?") and doesn't change edit box value in this code:

        CString g;
        ce.GetWindowText(g); // CEdit ce;
        ce.SetWindowText(g);

        When I use this code with any of rich edit controls I mentioned above, the value of edit control is changed to ANSI characters (all russian or any other international chars are converted to "?")... I don't understand this :\

        I could be happy with that, but as far as I know Win9x doesn't support unicode, so won't my project work on Win9x?

        Oxy

        P.S. I speak/understand russian, but I would type very slowly and poorly, so sorry for using english.
          Попробуй получить текст и перекодировать MultiByteToWideChar. Криво, но работает ... мне хватает! ;D
          0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)
          0 пользователей:


          Рейтинг@Mail.ru
          [ Script execution time: 0,0188 ]   [ 16 queries used ]   [ Generated: 2.05.24, 14:19 GMT ]