I have two project, Project1 and Project2, both project have rc file(resource.h), I want combime two resource into one project, for example, in Project1, I can use two resource: Project1's rc and Project2'2 rc; how can I do? thanks
2
votes
1 Answers
2
votes
It can be achieved by making use of TEXTINCLUDE resource directive mentioned here
Basic idea is to include required rc files in each others rc file, just like we include header files.
For example, in Project1.rc, you can include Project2.rc as shown below.
#ifdef APSTUDIO_INVOKED
// ... other directives if any
3 TEXTINCLUDE
BEGIN
// ... other definitions
"#include ""Project2\\Project2.rc""\0"
END
#endif // APSTUDIO_INVOKED
//... other resource entries
#ifndef APSTUDIO_INVOKED
#include "Project2\\Project2.rc"
#endif // not APSTUDIO_INVOKED
Now modify Project2.rc to include Project1.rc, as shown above.
resource.h
file is merged, or one included into the other, so that all the resource identifiers are defined. Note that you will probably need to resolve numbering conflicts. – void_ptr