Take the 2-minute tour ×

MFC is failing to launch my dialog boxes, it seems, because it can't find the resource identifiers. The dialog boxes are in a separate .lib file (so it has a separate .rc file, which, I'm assuming, somehow conflicts with the one in my .exe file). How should I be handling this situation?

share|improve this question
Can you give more details about how it is "failing to launch"? What are the specific symptoms? –  Pavel Minaev Oct 29 '09 at 7:23
I would call DoModal, and nothing would happen. Stepping in to the DoModal function revealed that the resource wasn't able to be loaded. –  Smashery Oct 29 '09 at 7:40

3 Answers 3

up vote 4 down vote accepted

In the .rc file for the .exe file, add a line like this:

#include "YourLibResourceFile.rc"

Then, in the .exe's project settings, add an additional include directory to where YourLibResourceFile.rc is, in Resources/Additional Include Directories.

share|improve this answer

You can't store resources (.rc files contents) in a static library. And since you can have only one "main" .rc file, all other .rc files mst be included in that one using an #include statement, such as explained by Smashery (Edit: Oh! Smashery, you are the OP!).

share|improve this answer
Yeah, I discovered this accidentally by myself =P Thanks for your answer! +1 –  Smashery Nov 5 '09 at 1:01

Make sure all your resource IDs are unique.

share|improve this answer

Your Answer


