Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Problem while displaying "Greek" and "Russian" Strings

Problem while displaying "Greek" and "Russian" Strings

Scheduled Pinned Locked Moved C / C++ / MFC
helpjsonquestion
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    msr_codeproject
    wrote on last edited by
    #1

    I am facing a strange problem. In my dialog application (Win32), I have a button control. I am loading a "Greek" string ("Επιλογή Εκτυπωτή")from a string DLL and trying to >Case-1 display on the button control. >Case-2 And also I am trying to use the same string to set the dialog's title. But here the problem is,on the button, text is displayed correctly, but dialog's title displayed as "?p???? ??t?p?t?" I am using (both for Case-1 and Case-2) >LoadStringW to load the string >SetWindowTextW to display While debugging, I found that strings are loaded properly in both the cases. I have also tried by changing code pages using setlocale API. But I couldn't solve this issue. Please provide me some tips so that I can move forward. Thanks in advance msr

    S L G 3 Replies Last reply
    0
    • M msr_codeproject

      I am facing a strange problem. In my dialog application (Win32), I have a button control. I am loading a "Greek" string ("Επιλογή Εκτυπωτή")from a string DLL and trying to >Case-1 display on the button control. >Case-2 And also I am trying to use the same string to set the dialog's title. But here the problem is,on the button, text is displayed correctly, but dialog's title displayed as "?p???? ??t?p?t?" I am using (both for Case-1 and Case-2) >LoadStringW to load the string >SetWindowTextW to display While debugging, I found that strings are loaded properly in both the cases. I have also tried by changing code pages using setlocale API. But I couldn't solve this issue. Please provide me some tips so that I can move forward. Thanks in advance msr

      S Offline
      S Offline
      Sauro Viti
      wrote on last edited by
      #2

      The difference is on the font used for the two items: are you sure that the font used for window titles supports greek characters?

      M 1 Reply Last reply
      0
      • S Sauro Viti

        The difference is on the font used for the two items: are you sure that the font used for window titles supports greek characters?

        M Offline
        M Offline
        msr_codeproject
        wrote on last edited by
        #3

        I have seen the dialog properties, the font is Microsoft Sans Serif. I think this font supports Greek also. Check Regards msr

        1 Reply Last reply
        0
        • M msr_codeproject

          I am facing a strange problem. In my dialog application (Win32), I have a button control. I am loading a "Greek" string ("Επιλογή Εκτυπωτή")from a string DLL and trying to >Case-1 display on the button control. >Case-2 And also I am trying to use the same string to set the dialog's title. But here the problem is,on the button, text is displayed correctly, but dialog's title displayed as "?p???? ??t?p?t?" I am using (both for Case-1 and Case-2) >LoadStringW to load the string >SetWindowTextW to display While debugging, I found that strings are loaded properly in both the cases. I have also tried by changing code pages using setlocale API. But I couldn't solve this issue. Please provide me some tips so that I can move forward. Thanks in advance msr

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I have just used your Greek phrase to set my dialog title and it appears correctly (font is MS Sans serif), so I cannot see what is different between your code and mine. Maybe you could show a bit more of your code as there may be a clue that you have missed.

          Just say 'NO' to evaluated arguments for diadic functions! Ash

          M 1 Reply Last reply
          0
          • L Lost User

            I have just used your Greek phrase to set my dialog title and it appears correctly (font is MS Sans serif), so I cannot see what is different between your code and mine. Maybe you could show a bit more of your code as there may be a clue that you have missed.

            Just say 'NO' to evaluated arguments for diadic functions! Ash

            M Offline
            M Offline
            msr_codeproject
            wrote on last edited by
            #5

            Hi, thanks for the reply. Here is my code.

            WCHAR* chr = L"Επιλογή Εκτυπωτή";
            HWND hWnd = ::GetDlgItem(m_hWnd, IDC_BUTTON);

            ::SetWindowTextW(m_hWnd, chr);
            ::SetWindowTextW(hWnd, chr);

            >> Where m_hWnd is handle to the Dialog and hWnd is handle to the Button. >> Output >> Button - "Επιλογή Εκτυπωτή" >> Dialog's Title - "?p????? ??t?p?t?" Regards msr

            L 1 Reply Last reply
            0
            • M msr_codeproject

              Hi, thanks for the reply. Here is my code.

              WCHAR* chr = L"Επιλογή Εκτυπωτή";
              HWND hWnd = ::GetDlgItem(m_hWnd, IDC_BUTTON);

              ::SetWindowTextW(m_hWnd, chr);
              ::SetWindowTextW(hWnd, chr);

              >> Where m_hWnd is handle to the Dialog and hWnd is handle to the Button. >> Output >> Button - "Επιλογή Εκτυπωτή" >> Dialog's Title - "?p????? ??t?p?t?" Regards msr

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              That is basically what I did and it worked fine. It would appear that the system is trying to translate the characters to a different font in the title of the dialog bar. I can only suggest rechecking your dialog settings, including verifying that the system is not sending a WM_SETFONT message which is changing it from your original font selection. Other than that I'm a bit lost I'm afraid. I am often reminded of a sentence in "Programming Windows 3.1" by Charles Petzold where he says (if I remember correctly): "No-one said it has to be to be easy". :(

              Just say 'NO' to evaluated arguments for diadic functions! Ash

              1 Reply Last reply
              0
              • M msr_codeproject

                I am facing a strange problem. In my dialog application (Win32), I have a button control. I am loading a "Greek" string ("Επιλογή Εκτυπωτή")from a string DLL and trying to >Case-1 display on the button control. >Case-2 And also I am trying to use the same string to set the dialog's title. But here the problem is,on the button, text is displayed correctly, but dialog's title displayed as "?p???? ??t?p?t?" I am using (both for Case-1 and Case-2) >LoadStringW to load the string >SetWindowTextW to display While debugging, I found that strings are loaded properly in both the cases. I have also tried by changing code pages using setlocale API. But I couldn't solve this issue. Please provide me some tips so that I can move forward. Thanks in advance msr

                G Offline
                G Offline
                gothic_coder
                wrote on last edited by
                #7

                Same happen to me when i tried to load "Chinese" string, But changing locale works for me..

                M 1 Reply Last reply
                0
                • G gothic_coder

                  Same happen to me when i tried to load "Chinese" string, But changing locale works for me..

                  M Offline
                  M Offline
                  msr_codeproject
                  wrote on last edited by
                  #8

                  Hi, Even I have tried by changing local, but it didn't work for me. Can you just brief me how did you change your locale. Give me some steps. Thanks in advance... Regards msr

                  modified on Thursday, October 21, 2010 4:47 AM

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups