[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

Resource collisions

Hello folks.
Our product is developed in Visual Studio 6.
It consists from more then 30 workspaces, we have the main one that is .exe file and all other are dlls.
I saw 3 main problems with resouce.h files
1) Different projects can have same ID name.
2) Different projects can have different IDs that have same numeric value.
3) ID may have numeric value that used by MFC (defined in AFXRes.h file) .
Do you know about any utility for diagnostic and fixing these problem.
  • 2
2 Solutions
If you do not build a large resource file by including all other resources and let every dll with its resources, you shouldn't have any problems.

But if you have compile/runtime problems:

1) You need to redefine them and recompile affected modules
2) Otherwise you can try to assign a resource IDs range for each module
3) That's not good, also redefine.

Also you can try this addin for VC++ http://www.codeproject.com/macro/resorg.asp
Are the dll's extension dll's or regular dll's.  A regular dll 'should' keep the resource ID's it uses to itself.  A duplicate name or ID number shouldn't give a problem.

I know this isn't a tool but have a look at AfxSetResourceHandle (in a dll it requires the handle to the dll - handle in InitInstance - DO NOT USE AfxGetResourceHandle).  That will put the dll as the first place to search for a resource.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now