We checked the ..\Prof-UIS\Include\Resources\Resource_deu.rc file and it contains correct string:
MENUITEM "A&utomatisch verbergen", ID_EXT_DYN_BAR_AUTO_HIDE
We inserted the following lines of code into the
CMainFrame
class constructor in the
MDIDOCVIEW sample application:
g_ResourceManager->AllowCustomLang();
g_ResourceManager->SetLangIdDesired( __EXT_MFC_LANG_ID_GERMAN );
And we saw the
Automatisch verbergen text. So, at least, we have this resource string translated and Prof-UIS Resource Manager was able to find and load it. There are couple possible reasons why you didn’t see this text in your application:
1) The
m_LanguageSupport.GetCurrentLanguage()
returns some language identifier which is not exactly equal to the
__EXT_MFC_LANG_ID_GERMAN
value that is defined as
MAKELANGID(LANG_GERMAN,SUBLANG_GERMAN)
where both language and sub-language parts are exactly very important.
2) The German resources are not available for loading because of your resource DLL was not loaded as correct MFC extension DLL. If your resource DLL is MFC extension DLL, then you should load it using
AfxLoadLibrary()
API. If it’s not an MFC extension DLL, then it should be loaded using the
LoadLibrary()
and registered in the resource manager using the
CExtResourceManager::RscInst_Insert()
method.
There are no other reasons to fail loading of localized resources of any type. You can insert the following code into the
MDIDOCVIEW sample application and into your application:
g_ResourceManager->AllowCustomLang();
g_ResourceManager->SetLangIdDesired( ID_EXT_DYN_BAR_AUTO_HIDE );
CExtSafeString sText;
g_ResourceManager->LoadString( sText, nId );
This will allow you to debug step by step the resource manager methods. You can enter the
CExtResourceManager::LoadString()
method, then
CExtResourceManager::LoadStringEx()
method, then the
CExtResourceManager::LoadResourceBufferEx()
method, then the
CExtResourceManager::LoadResourceBufferSingleLanguage()
method. The last method invokes the
CExtResourceManager::CExtResourceMemoryBuffer::FindAndLoad()
method many times trying to load the string data of the specified language from all the available locations. This will allow you to see all the available resource locations in the running instance of your application and in the
MDIDOCVIEW sample application.