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".


Who is Participating?
NickRepinConnect With a Mentor Commented:
No problem.
Go to Project->Settings
Go to Resources tab, choose Language: "Russian".
All russian strings must be in .rc file.
Of course, you have to run your program on Windows which has Russian locale in Control panel->Regional settings->Regional settings
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

sanekAuthor Commented:

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.

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];
   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
#pragma code_page(1251)

  1,"Russian string here"
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:

#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.
Feel free to ask me if problem still exists.
sanekAuthor Commented:
Thanks, Nick!
I'll try it this weekend (as soon as I get to my working enviroment).
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.
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.
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.
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.
sanekAuthor Commented:
Sorry for long-time evaluation...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.