Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create id labels working with various .rc files? 2

Status
Not open for further replies.

pererm

Programmer
Feb 11, 2002
27
ES
I´m working with various *.rc files in the same project. When you create anIDC_ or IDD_ or IDI_ or IDB_ number for resources and dialogs, Visual repeat frequently the same number. Is possible to change the number of the new resource at the end of resource.h file, but it´s very laborious if u work with a lot of controls and dialogs. Is an esay way for take the control of these numbers. What kind of problems colud i have if some resources have the same numbers? Thanks.
 
I would allocate a block of IDs for each resource file. Then, update all IDS in the header to fit into that region for each set of resources. Make sure to update the values at the bottom of the resource file (the NEXT values) so that the next automatically generated value for that resource comes after in the region you want it to.

Does that make sense? We've done something like this and once it is setup it works pretty well. I'm not sure if there is a better or more automatic way to handle it.
 
I've usually resorted to renumbering the resource.h file by hand, but Uolj's blocks make sense. You'd only have to modify the NEXT value once, immediately after creating the resource script.

Basically, resource1.rc would use values 1000-1099, resource2.rc would use 1100-1199, etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top