Can't load string from resource DLL's string table
-
Hi, I use resource DLLs to provide multilingual environment to users - user select language, I call AfxSetResourceHandle() with handle of relevant DLL and in all functions that load some kind of resource, I use AfxGetResourceHandle(). It works great (I have six resource DLLs now + base project, which is in english). Of course I use same resource symbols in resource.h, with the same values. But sometimes happens that I'm not able to load certain string from string table of one of DLLs. It has the same value assigned in resource.h as in all others DLLs but it just doesn't work. The only thing that helps that I must add new string to all DLLs and change the code to use this symbol instead of the old one. I really don't understand what the problem is What could be the reason? Have you ever met some similar problem?
-
Hi, I use resource DLLs to provide multilingual environment to users - user select language, I call AfxSetResourceHandle() with handle of relevant DLL and in all functions that load some kind of resource, I use AfxGetResourceHandle(). It works great (I have six resource DLLs now + base project, which is in english). Of course I use same resource symbols in resource.h, with the same values. But sometimes happens that I'm not able to load certain string from string table of one of DLLs. It has the same value assigned in resource.h as in all others DLLs but it just doesn't work. The only thing that helps that I must add new string to all DLLs and change the code to use this symbol instead of the old one. I really don't understand what the problem is What could be the reason? Have you ever met some similar problem?
To prevent the whole world being rebuilt whenever a resource file changes, Visual C++ ignores changes to the
resource.h
header file. You may find that a Rebuild All corrects this problem. -
To prevent the whole world being rebuilt whenever a resource file changes, Visual C++ ignores changes to the
resource.h
header file. You may find that a Rebuild All corrects this problem. -
Are all your resource files using the same
resource.h
file for their resource numbers, or are you adding new resources individually to each one? I'm not sure how well Visual C++ copes with multiple resource files - it seems to think that a resource header will only be associated with a single resource file, which I noticed when trying to rename a resource file... It might be better to define your resource numbers in your own header file; in the IDE, select View > Resource Includes, then add your own resource number file as a#include
in the Read-only symbol directives box. You'll have to declare the IDs manually rather than using the resource editor. You can use the resource editor once you've declared them. -
Are all your resource files using the same
resource.h
file for their resource numbers, or are you adding new resources individually to each one? I'm not sure how well Visual C++ copes with multiple resource files - it seems to think that a resource header will only be associated with a single resource file, which I noticed when trying to rename a resource file... It might be better to define your resource numbers in your own header file; in the IDE, select View > Resource Includes, then add your own resource number file as a#include
in the Read-only symbol directives box. You'll have to declare the IDs manually rather than using the resource editor. You can use the resource editor once you've declared them.All DLLs have their own resource.h file (but with the same content). So when I need add new resource, I just add the resource in MSVC++ Resource Editor and it does everything for me. It's just confusing for me that all six DLLs are working well exceptiong the only one...