在vcproj中自动添加版本资源 [英] Auto add Version Resource in vcproj

查看:71
本文介绍了在vcproj中自动添加版本资源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的VS解决方案中有很多项目.在每个项目中手动将版本资源手动添加到每个项目很烦人(即:右键单击项目,添加资源,然后从对话框中选择版本,然后单击新建).

对于所有项目,如何一次执行此操作?

Hi,

I have many projects in my VS solution. It is annoying to add version resource to every project manually one by one(i.e.: right click on project, add resource, then choose version from dialog, and click new).

How to do this at once for all the projects? Any Visual Studio macro or some other option?

推荐答案

对一个项目执行此操作,然后打开资源文件(.rc)作为源文件(右键单击并以文本打开)编辑).复制VS_VERSIONINFO块,然后粘贴到所有新项目的资源文件中.

无需程序即可处理资源文件的最快方法...
Do it for one project, then open the resource file (.rc) as source (right click and open with text editor). Copy the VS_VERSIONINFO block, and paste into all new projects'' resource files.

Fastest way to do it without a program that processes your resource files...


如果使用文本编辑器打开 rc 文件,则可以看到插入了版本信息块;您可以参考 VERSIONINFO资源(Windows) [
If you open an rc file with the text editor, you can see how a version info block is inserted; you can refer to VERSIONINFO Resource (Windows)[^] on the MSDN for the full syntax.

Said that you can write a macro for Visual Studio that look at the rc file of your project, searches for the VERSIONINFO inside it, and if it doesn''t exist the macro will add a standard one.


感谢您的回答,但您不理解我的问题.

添加资源后,Visual Studio会创建(.rc)文件.我知道如何编辑此文件,即使对于所有项目,也存在该文件时.

问题是我想一次为每个项目创建rc文件.我不想手动单击每个项目.

将rc文件添加到空的dll项目时,VC会自动生成filename.rc文件和两个文件:resource.h和filename.aps.

这是有关文件的信息:
http://msdn.microsoft.com/zh-CN -us/library/fywbdhak%28VS.71%29.aspx [ ^ ]

因此,我想为所有项目自动添加rc文件.

我试图为VS编写一些宏,但是我只能启动ech项目的AddResource对话框:
Thanks for answer, but you don''t understand my problem.

Visual Studio creates (.rc) files after we add resource. I know how to edit this file, even for all projects but when this files exist.

The problem is that i want to create rc file for every project at once. I don''t want to click at every project manually.

When adding a rc file to an empty dll project, VC will generate a filename.rc file and two files automatically: resource.h and filename.aps.

Here is the info about files: http://msdn.microsoft.com/en-us/library/fywbdhak%28VS.71%29.aspx[^]

So, I want to add rc file automatically for all projects.

I tried to write some macro for VS, but i''m only able to launch the AddResource dialog for ech project:
DTE.ExecuteCommand("Project.AddResource")



有什么建议吗?



Any suggestion?


这篇关于在vcproj中自动添加版本资源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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