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. Displaying Special symbols on the dialog window.

Displaying Special symbols on the dialog window.

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++question
5 Posts 2 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.
  • A Offline
    A Offline
    aravind sn
    wrote on last edited by
    #1

    Hello Im stuck with the problem of displaying special symbols say m_up_direction= "↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑"; or m_down_direction= "↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ "; on the dialog window(im using vc++ 6.0) could any please help ,e whether i need to type cast the expression or do any setting...?? -thanks

    S 1 Reply Last reply
    0
    • A aravind sn

      Hello Im stuck with the problem of displaying special symbols say m_up_direction= "↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑"; or m_down_direction= "↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ "; on the dialog window(im using vc++ 6.0) could any please help ,e whether i need to type cast the expression or do any setting...?? -thanks

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      I'm presuming that the arrow symbols are in the symbols font? In that case, you'll need something like this (it's taken pretty much verbatim from some of my own code):

      class MyDialog : public CDialog
      {
      CButton m_up_direction;
      CButton m_down_direction;
      CFont symbols_;
      };

      BOOL MyDialog::OnInitDialog()
      {
      CDialog::OnInitDialog();
      if (symbols_.CreatePointFont(100, "Symbol"))
      {
      m_up_direction.SetFont(&symbols_);
      m_down_direction.SetFont(&symbols_);
      }
      else // If we can't create the font, use some ugly ASCII-art arrow-esque figures.
      {
      m_up_direction.SetWindowText("^");
      m_down_direction.SetWindowText("V");
      }
      }

      Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

      A 1 Reply Last reply
      0
      • S Stuart Dootson

        I'm presuming that the arrow symbols are in the symbols font? In that case, you'll need something like this (it's taken pretty much verbatim from some of my own code):

        class MyDialog : public CDialog
        {
        CButton m_up_direction;
        CButton m_down_direction;
        CFont symbols_;
        };

        BOOL MyDialog::OnInitDialog()
        {
        CDialog::OnInitDialog();
        if (symbols_.CreatePointFont(100, "Symbol"))
        {
        m_up_direction.SetFont(&symbols_);
        m_down_direction.SetFont(&symbols_);
        }
        else // If we can't create the font, use some ugly ASCII-art arrow-esque figures.
        {
        m_up_direction.SetWindowText("^");
        m_down_direction.SetWindowText("V");
        }
        }

        Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

        A Offline
        A Offline
        aravind sn
        wrote on last edited by
        #3

        hey Stuart,, thanks ya for the reply,, but actually im trying to put the unicode strings on the window. also there is one more method to retrieve from an unicode file(where these ↑ and ↓ are being stored) and display it on the window.. since those stuffs make my project messy,, thought of putting direct unicode string in the code,, i thing may be the numeric value of the unicode may work...

        S 1 Reply Last reply
        0
        • A aravind sn

          hey Stuart,, thanks ya for the reply,, but actually im trying to put the unicode strings on the window. also there is one more method to retrieve from an unicode file(where these ↑ and ↓ are being stored) and display it on the window.. since those stuffs make my project messy,, thought of putting direct unicode string in the code,, i thing may be the numeric value of the unicode may work...

          S Offline
          S Offline
          Stuart Dootson
          wrote on last edited by
          #4

          aravind.sn wrote:

          but actually im trying to put the unicode strings on the window.

          I'm guessing that'll only work if IsWindowUnicode[^] returns TRUE for the window? Also, you'll either want to #define UNICODE and _UNICODE to get the Unicode APIs, or use the xxxW variants of the API calls.

          Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

          A 1 Reply Last reply
          0
          • S Stuart Dootson

            aravind.sn wrote:

            but actually im trying to put the unicode strings on the window.

            I'm guessing that'll only work if IsWindowUnicode[^] returns TRUE for the window? Also, you'll either want to #define UNICODE and _UNICODE to get the Unicode APIs, or use the xxxW variants of the API calls.

            Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

            A Offline
            A Offline
            aravind sn
            wrote on last edited by
            #5

            Thank you,, i just did and array of (unsigned short)decimal values for the unicode. then to CString. thanks stuart for ya reply... :)

            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