Russian interface in Windows application.

How can I use Russian fonts inside my application?
I need to use them for dispaying text, various messages, menus, e.t.c.
I have VS6 installed. When I use its wizzard for creating sample application, I don't have any choice for "Russian interface".

 

LVL 2
sanekAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NickRepinCommented:
No problem.
Go to Project->Settings
Go to Resources tab, choose Language: "Russian".
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NickRepinCommented:
All russian strings must be in .rc file.
0
NickRepinCommented:
Of course, you have to run your program on Windows which has Russian locale in Control panel->Regional settings->Regional settings
0
Become a CompTIA Certified Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

sanekAuthor Commented:
Nick,

I do have Russian Windows, Language was set to Russian (didn't have to change anything), and, I suppose, that string I changed as example (located in "about" window in project wizzard created) is located in .rc file.
Yet, the string is displayed incorrect.

0
NickRepinCommented:
Well, it also depends on whether you create console or GUI application.
Strictly to say, you can place the text inside .cpp file. But for GUI, you have to type it in Windows (ANSI) code page, for console - in DOS (OEM) code page.
Here is the sample.

Goto Project->Settings->Resources and check that Russian language is selected and "/l 0x419" is in Project Options window.

#include <windows.h>
#include <iostream.h>
int main(int argc, char* argv[])
{
   char buf[120];
   LoadString(GetModuleHandle(0),1,buf,120);
   MessageBox(0,buf,buf,MB_OK); // Correct text, GUI
   cout<<buf<<endl;  // Wrong text, console
   CharToOem(buf,buf); // ANSI->OEM
   cout<<buf<<endl;  // Correct text, console
   Sleep(5000); // Give time to read the text
   return 0;
}
----------------------

// .Rc filr

// There must be the following 2 lines
//in the .rc file before any russian
//string
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
#pragma code_page(1251)

STRINGTABLE {
  1,"Russian string here"
}
0
NickRepinCommented:
Crazy Microsoft VC++!

For example, create project:

File->New->Projects->Win32 application->Next->A typical Hello World->Finish

Go to Project->Settings
Go to Resources tab, choose Language: "Russian".

Go to Workspace window, Resources tab.
There are tree like in Windows explorer.
For example,

 [folder icon] String table
     String table (English(US))

Right-click on "String table(English(US))", choose Properties. Select Language Russian.

Make it for all resources.

Close your project.

Open .rc file of your project with text editor, find inside:

LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)

(or something except of LANG_RUSSIAN)

DELETE these lines.

Reopen project again.

Go to Workspace window, Resources tab and modify any string (eg, "Hello world!") with Russian text.

Compile project.

Now, when you will modify Russian text, all must be ok.
0
NickRepinCommented:
Feel free to ask me if problem still exists.
0
sanekAuthor Commented:
Thanks, Nick!
I'll try it this weekend (as soon as I get to my working enviroment).
0
sanekAuthor Commented:
Nick, that's worked! Thanks!
But... when I run the application in another (non-russian) Windows,
message appears incorrectly. How I can display russian text on these
platforms? How Netscape/IExplorer do it?
I suppose, they use different mechanism rather than just displaying ASCII characters.
0
NickRepinCommented:
To display Russian fonts on non-Russian windows, you have to adjust regional settings on that Windows:

1) Goto Control Panel->Regional settings->Regional settings tab
2) Select "Russian" in the list, check checkbox "Set as system default locale"
3) Click OK (Windows will ask to install russian fonts), reboot

Note that if you use non-standard windows font, this font must be installed on non-russian windows.
0
sanekAuthor Commented:
No, that is not a problem. I think.
Windows, on which I've tried my application, has Russian fonts
and both browsers NN/IE use them do display content.
Yet, my application is not capable of displaying cyrillic characters.
0
NickRepinCommented:
It is just cannot be. At least, I've tested the VC project above on English Windows NT. Make sure that you have copied the correct (new) executable to another PC.

Click Start->Run on English windows and try to enter something on Russian in the edit box.
0
sanekAuthor Commented:
Thanks.
Sorry for long-time evaluation...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.