Click here to Skip to main content
15,868,164 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have developed a GUI which I change code page to Russian and allmost all texts are i Russian except in a textbox which I try to display "30,47 M/C" (which means M/S i Russian) but displays "30,47 i/ñ" instead.
Could one be please to help me to understand how to correct the problem?
Thanks in advance
M.H
Posted

// I have developed a GUI which I change code page
In what way, please ?

// except in a textbox
How was it placed at the GUI surface ?

// try to display "30,47 M/C"
In what way, please ?

:)
 
Share this answer
 
Comments
merh 28-Sep-10 9:03am    
Its placed with SetWindowText(m_strDisplay) and CString m_strDisplay; // Holds the string that gets displayed.
Eugen Podsypalnikov 28-Sep-10 9:15am    
The "text box" seems to be coded in CP1252 (not in 1251)...
Can you put _this_ string at a button there (at the surface) properly ? :)
merh 28-Sep-10 11:13am    
The "text box" is in both English and Russian resource files. Because Im beginner in this case´, how can I code the "text box" in cp1251?
Eugen Podsypalnikov 28-Sep-10 12:14pm    
0. OS->NonUnicodeLaguage=Russian
1. In your .rc file, opened as text:
...
/////////////////////////////////////////////////////////////////////////////
// Russian resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
#ifdef _WIN32
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
#pragma code_page(1251)
#endif //_WIN32

IDD_RUSTEST_DIALOG DIALOGEX 0, 0, 320, 200
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION
EXSTYLE WS_EX_APPWINDOW
CAPTION "RusTest"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,209,179,50,14
PUSHBUTTON "Cancel",IDCANCEL,263,179,50,14
LTEXT "12,78 M/C",IDC_TEXT,54,53,57,24
END

STRINGTABLE
BEGIN
IDS_STRING129 "%.02f M/C"
END

...
2. in your .cpp :
GetDlgItem(IDC_TEXT)->SetWindowText("34,76 M/C");
or :
char szBuffer[MAX_PATH];
::LoadStringA(NULL, IDS_STRING129, szBuffer, MAX_PATH);
CString cszText;
cszText.Format(szBuffer, 12.98);
GetDlgItem(IDC_TEXT)->SetWindowText(cszText);
:)
Eugen Podsypalnikov 28-Sep-10 12:20pm    
Try also to transform your application to UNICODE,
it will be more comfortable :)
I didnt get you completely though,

why dont you try

"30,47 M//C"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900