开发者

Resources in a static lib file - MFC

开发者 https://www.devze.com 2022-12-10 05:11 出处:网络
MFC is fail开发者_C百科ing 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\'

MFC is fail开发者_C百科ing 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?


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.


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


Make sure all your resource IDs are unique.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号