Why this happen? is it a bug of mfc9.0

I write a program in vc++ 2008,and i want to make it support multiple
language. so i write a dll with all the resource build in it ,then i use the

function : LoadLibrary to Load the resource dll. last i use
AfxSetResourceHandle(hCurrLanguageInstanceHandle);still now the application
can run.

but when i change the visual style. for example i change the style to office
2007(blue style), the application will stop at line 7 below..

can someone help me. thanks !!!!!!

1 CTagManager tm;
2 if (!tm.LoadFromResource(GetStyleResourceID(m_Style), AFX_RT_STYLE_XML))
3 {
4 #if !defined _AFXDLL
5 TRACE(_T("\r\nImportant: to enable the Office 2007 look in static
6 TRACE(_T("include afxribbon.rc from the RC file in your
8 #endif
9 if (hinstResOld != NULL)
10 {
11 AfxSetResourceHandle(hinstResOld);
12 }
14 return;
15 }


Relevant Pages

  • Re: internationalisation
    ... So, for dialogs, we keep all of a projects dialogs in the exe rather than ... separate copies in each language dll. ... It shows you how to build dialogs without resource files. ...
  • Re: multiple language support: dialog-boxes
    ... If the user press the button btn1, the language should be changed. ... Resource only DLLs are in the same directory as the exe. ... When you need to change language, the program presents a list of language names, and selecting the language loads the corresponding DLL, and remembers its HINSTANCE. ...
  • Internationalization / Globalization / Localization - Best way?
    ... I'm looking for a best way to localize applications to different ... languages with separate resource library (DLL) per language. ... actual language and used the resources with the API funktions. ...
  • Re: Best practice to handle "Resource Only Dlls"
    ... and pull the strings and other resources from there. ... In MFC you just set up the dll to be Resource ... The main language is kept in the program assembly, and each language gets its own folder under the program directory, named by the language code. ...
  • Re: ? Segregating a Dialogs Code (Particularly Resources)
    ... Some of our programmers do this and since my application has to consume all the DLLs I end up with the DLL and 10 other language DLLs for each little piece of the program which ends up being about 50 DLLs in my case. ... I often use DLLs from other applications either to start with or just to use, but I typically just copy the content files and then open both resource files and drag the resources over to the new project. ... I have put the dialog's code in a separate file (in a subdirectory of the main ...