Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. C / C++ / MFC
  3. Support MultiLanguage in VC

Support MultiLanguage in VC

Scheduled Pinned Locked Moved C / C++ / MFC
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hs
    wrote on last edited by
    #1

    I want my application which is written with VC to support Multiple language. i did the follow: first, i put resource to dlls, each dll is for one language, then, CMyApp::InitInstance() { int nLang = detect_which_language_to_use(); CString strLang; strLang.Format("Lang%d.dll", nLang); //load the resource HINSTANCE hInstance = ::LoadLibrary(LPCTSTR(strLang)); ASSERT(hInstance); ::AfxSetResourceHandle(hInstance); } it works. but now i want to let the user choose the language, that is, i add a menu in my program, user can choose the language he want by clicking the menu. how can i do these? thanks. hs

    M 1 Reply Last reply
    0
    • H hs

      I want my application which is written with VC to support Multiple language. i did the follow: first, i put resource to dlls, each dll is for one language, then, CMyApp::InitInstance() { int nLang = detect_which_language_to_use(); CString strLang; strLang.Format("Lang%d.dll", nLang); //load the resource HINSTANCE hInstance = ::LoadLibrary(LPCTSTR(strLang)); ASSERT(hInstance); ::AfxSetResourceHandle(hInstance); } it works. but now i want to let the user choose the language, that is, i add a menu in my program, user can choose the language he want by clicking the menu. how can i do these? thanks. hs

      M Offline
      M Offline
      Masaaki Onishi
      wrote on last edited by
      #2

      Hello, the codegurus around the world. ;) Before you make the multi-language application, you had better consider the followings. For example, 1) English Windows 9x can't show Japanese corretly. 2) Some Japanese user can't understand English. So, what language will you use for the menu item? English?? At the menu, we can use CDialog class with the radio button something like that for the user to select the language.... But before that, you must solve some problems.... :( Have a nice day! -Masaaki Onishi-

      H L 2 Replies Last reply
      0
      • M Masaaki Onishi

        Hello, the codegurus around the world. ;) Before you make the multi-language application, you had better consider the followings. For example, 1) English Windows 9x can't show Japanese corretly. 2) Some Japanese user can't understand English. So, what language will you use for the menu item? English?? At the menu, we can use CDialog class with the radio button something like that for the user to select the language.... But before that, you must solve some problems.... :( Have a nice day! -Masaaki Onishi-

        H Offline
        H Offline
        hs
        wrote on last edited by
        #3

        i change the resource(AfxSetResourceHandle) by clicking a menu item, then i show new a dialog,my program use the dialog accord to my choice, but the GUIs which had been showed was not effected.

        M 1 Reply Last reply
        0
        • H hs

          i change the resource(AfxSetResourceHandle) by clicking a menu item, then i show new a dialog,my program use the dialog accord to my choice, but the GUIs which had been showed was not effected.

          M Offline
          M Offline
          Masaaki Onishi
          wrote on last edited by
          #4

          Hello, the codegurus around the world. ;) Actually, I don't understand your problem very well, but if I guess.... After the code passes the point of AfxSetResourceHandle, the application can't change the resouce DLL. (However, we may use FindResouce API function for each resouce ID..?) So, before AfxResourceHandle is called, we must choose which resouce DLL will be used. As a result, CMyDialog dlg (AfxGetMainWnd()); // for the bug of Windows ME. dlg.DoModal(); // with the radio button ? // Get the data which the user selects as the language from the dialog; if (sLang == EN)... HINSTANCE hInst = Loadlibrary (someDLL); if (hInst) AfxResourceHandle(hInst); ...... // After this, we can't change resouce DLL. Have a nice day! -Masaaki Onishi-

          1 Reply Last reply
          0
          • M Masaaki Onishi

            Hello, the codegurus around the world. ;) Before you make the multi-language application, you had better consider the followings. For example, 1) English Windows 9x can't show Japanese corretly. 2) Some Japanese user can't understand English. So, what language will you use for the menu item? English?? At the menu, we can use CDialog class with the radio button something like that for the user to select the language.... But before that, you must solve some problems.... :( Have a nice day! -Masaaki Onishi-

            L Offline
            L Offline
            l a u r e n
            wrote on last edited by
            #5

            actually masaaki you could put a menu of bitmaps of flags to select the language you wanted as they do on many web sites :) --- "every year we invent better idiot proof systems and every year they invent better idiots"

            M 1 Reply Last reply
            0
            • L l a u r e n

              actually masaaki you could put a menu of bitmaps of flags to select the language you wanted as they do on many web sites :) --- "every year we invent better idiot proof systems and every year they invent better idiots"

              M Offline
              M Offline
              Masaaki Onishi
              wrote on last edited by
              #6

              Hello, the codegurus around the world. ;) lauren: I am already working for the other part of bitmaps for the international language. However, if we use the international language by bitmap format, we had better be careful about the appearance of this. For example, like the menu, 1) Japanese (normal letter on Dialog) - (Japanese) by bitmap. This bitmap had better have the same color of the background like the dialog as well as the same size of the font as the normal letter of dialog. As a result, we work more than we expect ....:( Have a nice day! -Masaaki Onishi-

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups