Link to home
Start Free TrialLog in
Avatar of AlexFM
AlexFM

asked on

Multilanguage support

I have some old program which doesn't handle correctly data in non-English language. I can type successfully non-English (for example, Russian) text in textboxes. Data is successfully written to database and extracted from it. However, listboxes and tree controls display this data as black rectangles.
Trying to reproduce this, I create new MFC application with VC++ 8.0, but it works correctly.
Some information about old project. It was created in VC++ 6.0, in Unicode configuration. Later it was converted to VC++ 8.0. It contains executable project and number of MFC extension Dll. Executable project contains only main frame, all other stuff (dialogs etc.) is in Dll.
What can be a reason of this behavior?
Avatar of AlexFM
AlexFM

ASKER

I made additional test and found that this problem is related to Dll. I added edit box and listbox to About dialog (exe project). By clicking the button text is added from editbox to listbox. Russian text is displayed properly.
Then I did the same in the dialog in MFC extension Dll. Text is not displayed correctly in the listbox. How can I fix this?
Avatar of AlexFM

ASKER

When I did the same in the new project (added Dll with dialog), it works. So, the problem is old Dll projects.
Avatar of AndyAinscow
If it works with VC 8 isn't just recompiling an option to 'fix' it
Is it a font problem in the display?  
Avatar of AlexFM

ASKER

>> If it works with VC 8 isn't just recompiling an option to 'fix' it.

It is recompiled under VC++ 8.0.

>> Is it a font problem in the display?  
I don't know, I run both programs on the same computer. Old project doesn't work, new one works. All controls are standard, I don't select any font for them.
>>It was created in VC++ 6.0, in Unicode configuration
>>However, listboxes and tree controls display this data as black rectangles.

About display UNICODE characters in List Control and Edit Controls Have you followed this :

http://www.codeguru.com/cpp/cpp/cpp_mfc/general/article.php/c10285/ <====


MAHESH
I think you need to create unicode font as shown in SetControlsFont() in above link... Also refer other functions..

MAHESH
ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AlexFM

ASKER

Good guess. I compared fonts in the new project (this is just small test project) and old project. Both have the same font - Microsoft Sans Serif. But I changed font in old project to Courier New, and now Russian text "Ivan Petrovich :)" is shown. Now I know what to do, thank you!

mahesh1402, thanks, but this link is not for my case.