在.RC文件中将资源文件包含在项目中,而不是.RES文件 [英] Including resource file in a project by .RC file rather than .RES file

查看:149
本文介绍了在.RC文件中将资源文件包含在项目中,而不是.RES文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我记得阅读几年前的一篇文章或文章,建议通过引用.rc文件而不是已经编译的.res文件将资源文件包含在项目中,以便将资源构建为项目构建过程的一部分。



我有一个glyphs.rc文件,我目前使用命令brcc32 glyphs.rc进行编译。在我的项目文件中,我将有一个声明{$ R Glyphs.res}。



我想通过将其更改为

  {$ R Glyphs.rc} 

,但不确定语法。当我尝试使用 {$ R Glyphs.rc} 我得到一个错误`

  [DCC错误] E2161错误:RLINK32:文件Glyphs.rc中不支持的16位资源。 

Delphi 2007是否可以使用此方法?

解决方案

只需将rc文件通过项目>添加到项目菜单项添加到项目中即可。这从 {$ R'myres.res''myres.rc'} 1298031 / include-resource-file-in-a-project-by-rc-file-than-res-file / 1298086#1298086> TOndrej指向


I remember reading an article or post somewhere years ago that suggested including a resource file in a project by referencing the .rc file instead of an already compiled .res file so that the resource is built as part of the project's build process.

I have a glyphs.rc file that I currently compile using the command brcc32 glyphs.rc. In my project file I then have the statement {$R Glyphs.res}.

I'd like to simplify this by changing it to something like

{$R Glyphs.rc} 

but am unsure of the syntax. When I try using {$R Glyphs.rc} I get an error `

[DCC Error] E2161 Error: RLINK32: Unsupported 16bit resource in file "Glyphs.rc". 

Is this approach possible with Delphi 2007?

解决方案

Just add the rc file to your project via the "Project > Add to project" menu item. This creates the {$R 'myres.res' 'myres.rc'} line from the posting that TOndrej links to.

这篇关于在.RC文件中将资源文件包含在项目中,而不是.RES文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆