开发者

Including common resources in multiple projects on different nesting levels (visual C++)

I have an rc file that uses relative paths to locate the resource files (pictures etc.), for example

IDB_LINE                BITMAP                  "..\\Shared\\Res\\line.bmp"

BUT - a few projects are including the rc file, and these projects are found on different directory nesting levels inside the solution.

As a result, some of them can't find the relative path, unless I perform some patchy soluti开发者_开发知识库on (duplicate the resources, create a hard link to the resources dir etc.).

I would have liked the rc file to look at its own directory for the resources files, but it doesn't do that unfortunately.

Alternatively, is there any way to reference the content of the $SolutionDir variable from within a header/resource script(rc) file?


You can define include paths for data included into resources, just as for header files included into source -- you should be able to find it in the right-click > Properties for the resource file, though as I recall it takes a little bit of finding the right tab (lack of detail as I don't have VC++ on this laptop).

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜