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

LANGID

Scheduled Pinned Locked Moved C / C++ / MFC
questiondata-structureshelptutorial
4 Posts 2 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.
  • Z Offline
    Z Offline
    zon_cpp
    wrote on last edited by
    #1

    hi, how do i get a list of LANGID in array? i want initialize an array with LANGIDs (for example i do this in a loop).

    int count; // = ? number of LANGID
    WORD* arr = new WORD[count];
    // now how do id initialize this array completely?

    please help me

    Zo.Naderi-Iran

    L 3 Replies Last reply
    0
    • Z zon_cpp

      hi, how do i get a list of LANGID in array? i want initialize an array with LANGIDs (for example i do this in a loop).

      int count; // = ? number of LANGID
      WORD* arr = new WORD[count];
      // now how do id initialize this array completely?

      please help me

      Zo.Naderi-Iran

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      The current list should be in file WinNT.h; search for keyword LANG_NEUTRAL. See also second response.

      Unrequited desire is character building. OriginalGriff

      1 Reply Last reply
      0
      • Z zon_cpp

        hi, how do i get a list of LANGID in array? i want initialize an array with LANGIDs (for example i do this in a loop).

        int count; // = ? number of LANGID
        WORD* arr = new WORD[count];
        // now how do id initialize this array completely?

        please help me

        Zo.Naderi-Iran

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        Further research suggests you should use one of the locale support functions such as EnumSystemLocalesEx()[^].

        Unrequited desire is character building. OriginalGriff

        1 Reply Last reply
        0
        • Z zon_cpp

          hi, how do i get a list of LANGID in array? i want initialize an array with LANGIDs (for example i do this in a loop).

          int count; // = ? number of LANGID
          WORD* arr = new WORD[count];
          // now how do id initialize this array completely?

          please help me

          Zo.Naderi-Iran

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          zon_cpp wrote:

          how do i get a list of LANGID in array?

          Hi, I believe Microsoft discourages using the MLANG interface. At least that's what it use to say on MSDN. However I looked just now and could not find the do-not-use disclaimer. With that being said... A few years ago I managed to figure out how to use some of the vaguely documented interfaces. Here is what I use to enumerate available locales:

          HRESULT hr = CoInitialize(NULL);
          if(SUCCEEDED(hr))
          {
          IMultiLanguage * pml;
          hr = CoCreateInstance(CLSID_CMultiLanguage,NULL,CLSCTX_ALL,IID_IMultiLanguage,(void**)&pml);
          if(SUCCEEDED(hr))
          {
          RFC1766INFO info;
          ULONG num;
          IEnumRfc1766 *rfc1766;
          hr = pml->EnumRfc1766(&rfc1766);
          if(SUCCEEDED(hr))
          {
          while(S_OK == rfc1766->Next(1,&info,&num))
          {
          WORD wLangID = LANGIDFROMLCID(info.lcid);
          //You can also get the locale name such as 'English' or 'Chinese' at info.wszLocaleName[32]
          }
          }
          }
          pml->Release();
          }
          CoUninitialize();

          Best Wishes, -David Delaune

          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