LANGID
-
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
-
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
The current list should be in file WinNT.h; search for keyword
LANG_NEUTRAL
. See also second response.Unrequited desire is character building. OriginalGriff
-
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
Further research suggests you should use one of the locale support functions such as EnumSystemLocalesEx()[^].
Unrequited desire is character building. OriginalGriff
-
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
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