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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Need help displaying Chinese characters in a CListCtrl

Need help displaying Chinese characters in a CListCtrl

Scheduled Pinned Locked Moved C / C++ / MFC
help
3 Posts 3 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.
  • R Offline
    R Offline
    Raymond So
    wrote on last edited by
    #1

    Hi, I need help on trying to display Chinese characters in a CListCtrl. I have _UNICODE flag in project settings, and I'm using the unicode conventions (i.e., _T() for string literals, _tcscpy in place of strcpy(), etc.). Still no luck, I've even tried to set the font: CFont *cFontPtr = m_CertListCntrl.GetFont(); LOGFONT lFontObj; int success = cFontPtr->GetLogFont(&lFontObj); lFontObj.lfCharSet = CHINESEBIG5_CHARSET; CFont cfObj; BOOL s = cfObj.CreateFontIndirect(&lFontObj); m_CertListCntrl.SetFont(&cfObj, TRUE); And still no luck. Note: I tried to test the code by hard coding chinese characters and filling in the list. Not sure if that has an effect on it. Thanks, Raymond

    Y M 2 Replies Last reply
    0
    • R Raymond So

      Hi, I need help on trying to display Chinese characters in a CListCtrl. I have _UNICODE flag in project settings, and I'm using the unicode conventions (i.e., _T() for string literals, _tcscpy in place of strcpy(), etc.). Still no luck, I've even tried to set the font: CFont *cFontPtr = m_CertListCntrl.GetFont(); LOGFONT lFontObj; int success = cFontPtr->GetLogFont(&lFontObj); lFontObj.lfCharSet = CHINESEBIG5_CHARSET; CFont cfObj; BOOL s = cfObj.CreateFontIndirect(&lFontObj); m_CertListCntrl.SetFont(&cfObj, TRUE); And still no luck. Note: I tried to test the code by hard coding chinese characters and filling in the list. Not sure if that has an effect on it. Thanks, Raymond

      Y Offline
      Y Offline
      yndfcd
      wrote on last edited by
      #2

      You need a Chinese Operation System.

      1 Reply Last reply
      0
      • R Raymond So

        Hi, I need help on trying to display Chinese characters in a CListCtrl. I have _UNICODE flag in project settings, and I'm using the unicode conventions (i.e., _T() for string literals, _tcscpy in place of strcpy(), etc.). Still no luck, I've even tried to set the font: CFont *cFontPtr = m_CertListCntrl.GetFont(); LOGFONT lFontObj; int success = cFontPtr->GetLogFont(&lFontObj); lFontObj.lfCharSet = CHINESEBIG5_CHARSET; CFont cfObj; BOOL s = cfObj.CreateFontIndirect(&lFontObj); m_CertListCntrl.SetFont(&cfObj, TRUE); And still no luck. Note: I tried to test the code by hard coding chinese characters and filling in the list. Not sure if that has an effect on it. Thanks, Raymond

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        You need to set the font name in the LOGFONT struct to one that contains the characters, like SimSun. --Mike-- Ericahist [updated Oct 26] | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber There is a saying in statistics that a million monkeys pounding on typewriters would eventually create a work of Shakespeare. Thanks to the Internet, we now know that this is not true.

        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