Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resources in a static lib file - MFC

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?

like image 744
Smashery Avatar asked Dec 20 '25 08:12

Smashery


2 Answers

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.

like image 141
Smashery Avatar answered Dec 21 '25 22:12

Smashery


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!).

like image 41
Serge Wautier Avatar answered Dec 21 '25 23:12

Serge Wautier