Need help displaying Chinese characters in a CListCtrl
-
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
-
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
-
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
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.