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. General Programming
  3. C / C++ / MFC
  4. how to build a multilingual application?

how to build a multilingual application?

Scheduled Pinned Locked Moved C / C++ / MFC
questiontutorial
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.
  • R Offline
    R Offline
    Rene De La Garza
    wrote on last edited by
    #1

    i need to build an application and it needs to support some languages, how can i do it, how to change from one language to another?

    T R 2 Replies Last reply
    0
    • R Rene De La Garza

      i need to build an application and it needs to support some languages, how can i do it, how to change from one language to another?

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      http://www.codeproject.com/cpp/introtolocalization.asp[^] http://www.codeproject.com/tips/internationalization.asp[^] Tomasz Sowinski -- http://www.shooltz.com

      *** Vodka. Connecting people. ***

      R 1 Reply Last reply
      0
      • R Rene De La Garza

        i need to build an application and it needs to support some languages, how can i do it, how to change from one language to another?

        R Offline
        R Offline
        Roman Fadeyev
        wrote on last edited by
        #3

        Create some resource DLL's (dll that contains only resources without a code) for different languages. Type in CYourApp::InitInstance : hI=LoadLibrary(....) AfxSetResourceHandle(hI); unfortunately switching of language on the fly without application reboot is difficult task since you must recreate all objects (menus, toolbars, dialogs and so on)

        R 1 Reply Last reply
        0
        • T Tomasz Sowinski

          http://www.codeproject.com/cpp/introtolocalization.asp[^] http://www.codeproject.com/tips/internationalization.asp[^] Tomasz Sowinski -- http://www.shooltz.com

          *** Vodka. Connecting people. ***

          R Offline
          R Offline
          Rene De La Garza
          wrote on last edited by
          #4

          thanks for the links.

          1 Reply Last reply
          0
          • R Roman Fadeyev

            Create some resource DLL's (dll that contains only resources without a code) for different languages. Type in CYourApp::InitInstance : hI=LoadLibrary(....) AfxSetResourceHandle(hI); unfortunately switching of language on the fly without application reboot is difficult task since you must recreate all objects (menus, toolbars, dialogs and so on)

            R Offline
            R Offline
            Rene De La Garza
            wrote on last edited by
            #5

            thanks i`ll try that, and what can you suggest me to change them on the fly?

            R 1 Reply Last reply
            0
            • R Rene De La Garza

              thanks i`ll try that, and what can you suggest me to change them on the fly?

              R Offline
              R Offline
              Roman Fadeyev
              wrote on last edited by
              #6

              I can't offer anything more cleverly as something like that example: //Destroy for(int i = 0; i < m_arrToolbars.GetSize(); i++) { pToolbar = (CToolBar*)m_arrToolbars[i]; pToolbar->DestroyWindow(); delete pToolbar; }: ... //Create //Let's suppose you have array with all pointers to CTollbars for(i = 0; i < m_arrToolbarIDs.GetSize(); i++) { UINT nID = (UINT)m_arrToolbarIDs[i]; // create new pToolbar = new CToolBar(); if (!pToolbar->CreateEx(m_pMainFrame, TBSTYLE_FLAT, WS_CHILD | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC, CRect(1,1,1,1), AFX_IDW_TOOLBAR + nID) || !pToolbar->LoadToolBar(nID)) { TRACE(_T("Failed to create view's toolbar from Resource %d\n"), nID); delete pToolbar; continue; // fail to create this toolbar but try others } ASSERT(::IsWindow(pToolbar->GetSafeHwnd())); // set toolbar title CString csTitle; csTitle.LoadString(m_arrToolbarTitleIDs[i]); pToolbar->SetWindowText(csTitle); // cache the pointer tho the new created toolbar m_arrToolbars.Add(pToolbar); } But it's a very little part of changing interface - only for toolbars. Similarly you should execute such operation for all objects including all dialogs. However why you should make the complications to yourself? It is easier to reboot application :)

              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