Re: Resource dll question...
You can get the "best language" by querying the locale (region) settings. I
use code that looks like this:
LCID lcid = ::GetThreadLocale();
lcid = LANGIDFROMLCID(lcid);
CString csResourceDLL;
LogEvent(csResourceDLL = GetResourceFilename(lcid, _T("MyApp%1.dll")));
lcid = MAKELANGID(lcid&0xff, SUBLANG_DEFAULT);
m_csLCID.Format(_T("%04x"), lcid);
switch(lcid) {
case 0x0409:
LogEvent(m_gVersionType = VERSION_ENGLISH);
break;
case 0x0407:
LogEvent(m_gVersionType = VERSION_GERMAN);
break;
case 0x040a:
LogEvent(m_gVersionType = VERSION_SPANISH);
break;
case 0x040c:
LogEvent(m_gVersionType = VERSION_FRENCH);
break;
case 0x0410:
LogEvent(m_gVersionType = VERSION_ITALIAN);
break;
case 0x0411:
LogEvent(m_gVersionType = VERSION_JAPANESE);
break;
}
//
// Creates a resource file name (for a DLL) given the locale id and a format
string.
//
CString GetResourceFilename(UINT nLID, LPCTSTR cFormat)
{
CString csHex, cs;
nLID = MAKELANGID(nLID&0xff, SUBLANG_DEFAULT);
csHex.Format(_T("%04x"), nLID);
cs.FormatMessage(cFormat,csHex);
return cs;
}
I only use the SUBLANG_DEFAULT so that makes it work for more locales.
Tom
"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message
news:1145985573.386155.307850@y43g2000cwc.googlegroups.com...
will MFC/ATL automatically use the best language in the dll?
There is nothing like the best language. YOu will need to load the
appropriate resource DLL. In addition, you may want to run a foreign
language on a English version of OS and vice versa.
---
Ajay