Unicode support in CEdit
-
Dear All, I want to disply the character ♠ in the CEdit but this only getting diplayed when I change the project settings to Unicode. But to display this single character, I need to change my entire project which seems a huge task for me. I planned to do some alternative for this. Is it possible to extend a CEdit class to display unicode characters and then to include that class to my main project without changing the existing settings of my main project. Please advice me. Many thanks in advance.
-
Dear All, I want to disply the character ♠ in the CEdit but this only getting diplayed when I change the project settings to Unicode. But to display this single character, I need to change my entire project which seems a huge task for me. I planned to do some alternative for this. Is it possible to extend a CEdit class to display unicode characters and then to include that class to my main project without changing the existing settings of my main project. Please advice me. Many thanks in advance.
CDC *pDC = GetDC(); CFont m_Font; LOGFONT lFont; memset(&lFont, 0, sizeof(lFont)); lFont.lfHeight = MulDiv(20, ::GetDeviceCaps(pDC->m_hDC, LOGPIXELSY), 12 ); lFont.lfWeight = FW_NORMAL; lFont.lfOutPrecision = OUT_TT_ONLY_PRECIS; wcscpy( lFont.lfFaceName, _T("Lucida Sans Unicode")); // Set the Font m_Font.CreateFontIndirect(&lFont); // Set the specified font for the edit ctrl. m_edit.SetFont(&m_Font);
Величие не Бога может быть недооценена.
-
CDC *pDC = GetDC(); CFont m_Font; LOGFONT lFont; memset(&lFont, 0, sizeof(lFont)); lFont.lfHeight = MulDiv(20, ::GetDeviceCaps(pDC->m_hDC, LOGPIXELSY), 12 ); lFont.lfWeight = FW_NORMAL; lFont.lfOutPrecision = OUT_TT_ONLY_PRECIS; wcscpy( lFont.lfFaceName, _T("Lucida Sans Unicode")); // Set the Font m_Font.CreateFontIndirect(&lFont); // Set the specified font for the edit ctrl. m_edit.SetFont(&m_Font);
Величие не Бога может быть недооценена.
Dear ARJ, Many thanks for your reply. The real problem is that the above code will work only if we set the project properties to Unicode otherwise the above won't work. I want to display those control characters in CEdit without changing my main project's project setting to Unicode.
-
Dear All, I want to disply the character ♠ in the CEdit but this only getting diplayed when I change the project settings to Unicode. But to display this single character, I need to change my entire project which seems a huge task for me. I planned to do some alternative for this. Is it possible to extend a CEdit class to display unicode characters and then to include that class to my main project without changing the existing settings of my main project. Please advice me. Many thanks in advance.
-
Dear All, I want to disply the character ♠ in the CEdit but this only getting diplayed when I change the project settings to Unicode. But to display this single character, I need to change my entire project which seems a huge task for me. I planned to do some alternative for this. Is it possible to extend a CEdit class to display unicode characters and then to include that class to my main project without changing the existing settings of my main project. Please advice me. Many thanks in advance.
bhanu_reddy09 wrote:
But to display this single character, I need to change my entire project which seems a huge task for me.
I'll recommend that you convert your project to Unicode, and it is the ideal way of doing it. Unless your code uses some kind of a third party library that doesn't support Unicode, I don't see a reason why you should not do a fully Unicode build. You can always come here and ask questions if you run into trouble.
It is a crappy thing, but it's life -^ Carlo Pallini