如何在 Visual Studio 6.0 或 Embedded VC 中将对话框资源从一个项目复制到另一个项目 (电动车)?

发布于 2024-07-08 20:02:16 字数 130 浏览 11 评论 0原文

我有两个代码分支。 1 有一个对话框,而另一个没有,但由于政治原因,该对话框没有移到最新的分支中。 现在他们想要它......

那么是否可以将对话框从一个项目复制到另一个项目。 似乎有导出和导入功能,但它是灰色的。

I've got two branches of code. 1 has a dialog box that the other doesn't, but because of politics the dialog box wasn't moved into the newest branch. Now they want it in...

So is it possible to copy a dialog box from one project to another.
There apears to be an export and import feature however it's greyed out.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

绻影浮沉 2024-07-15 20:02:16

.RC ​​文件是简单的文本文件。 您只需将 DIALOG 文本从一个 .RC 文件复制/粘贴到另一个 .RC 文件即可。 确保您也复制了相应的 RESOURCE.H 条目。

或者,您也可以打开两个 .RC 文件,然后只需将对话框从一个文件拖放到另一个文件即可。

.RC files are simple text files. You can simply copy/paste the DIALOG text from one .RC file to the other. Make sure that you copy the corresponding RESOURCE.H entries as well.

Alternatively, you might be able to open both .RC files and then simply drag-and-drop the dialog from one to the other.

誰認得朕 2024-07-15 20:02:16

Visual Studio 2010 - 2013 更新:

您仍然可以进行拖放和复制粘贴,但只能在项目/解决方案之外进行。

关闭解决方案,将两个 RC 作为文件打开,无需任何打开的解决方案,然后继续。 对于拖动,“按住 CTRL 键并将资源拖动到第二个 .rc 文件。例如,将 IDD_DIALOG1 从 Source1.rc 拖动到 Source2.rc。”

Microsoft - 如何复制资源

Update for Visual Studio 2010 - 2013:

You can still drag-drop and copy-paste, but only outside of your project / solution.

Close solution, open both RC as files without any open solution, and go. For drag, "Hold down the CTRL key and drag the resource to the second .rc file. For example, drag IDD_DIALOG1 from Source1.rc to Source2.rc."

Microsoft - How to Copy Resources

书信已泛黄 2024-07-15 20:02:16

拖放操作在 Visual Studio 2010 中不起作用。编辑 .RC 文件确实有效,但要小心。 对我来说,对话框的 ID 显示为 *ID_etc*。 我复制了它并删除了*,它似乎解决了问题。

Drag and drop doesn't work in Visual Studio 2010. Editing the .RC file does work but be careful. For me the ID for the dialog showed up with *ID_etc*. I copied it and removed the *'s and it seemed to fix the problem.

数理化全能战士 2024-07-15 20:02:16

我终于弄清楚如何将对话框从一个解决方案复制到另一个解决方案。
步骤:

  1. 在单独的窗口中打开两个解决方案。
  2. 添加新的空白对话框-添加资源-> add->newDialog
  3. 打开两个对话框 打开二进制数据。
  4. 将二进制数据从源解决方案对话框复制到目标对话框

I finally figure it out how to copy a Dialog from one solution to another.
Steps:

  1. Open both solutions in separte windows.
  2. Add a new Blank Dialog -Add Resources-> add->newDialog
  3. Open Both Dialogs Open Binary data.
  4. Copy the Binary data from source solution dialog to Destination Dialog
吲‖鸣 2024-07-15 20:02:16

这只是为了向已接受的答案(由 Roger Lipscombe 提供)及其步骤添加一些视觉细节。

为了将对话框等资源从一个项目复制到另一个项目,可以遵循以下步骤。

  1. 启动 Visual Studio 的新实例。
  2. 将源和目标 .RC 文件作为文件打开,如图所示。
  3. 从源 RC 文件中,复制所需的对话框。
  4. 切换到目标 RC 文件选项卡并粘贴即可。

请注意,此操作会更新resource.h 文件。 这是 Visual Studio 提供的极好的帮助。

必须确保resource.h 文件中不存在重复的资源ID。 在处理一些旧项目时,发现存在一些重复的资源 ID,必须手动更正。 看来这样的努力值得考虑否则所需的艰巨任务。

输入图片此处描述

This is just to add some visual detail to the accepted answer (by Roger Lipscombe) along with its steps.

In order to copy a resource such as a Dialog from one project another project, below steps can be followed.

  1. Start a new instance of Visual Studio.
  2. Open both source and destination .RC file as files, as shown in the picture.
  3. From the source RC file, copy required dialog.
  4. Switch to the destination RC file tab and simply paste it.

Please note that this operation would have updated the resource.h file. That is an excellent help by Visual Studio.

One will have to make sure that no duplicate resource IDs are present in the resource.h file. When working with some legacy projects, it is found that there came some duplicate resource Ids that had to be manually corrected. It looks like such an effort is worth considering the mammoth task required otherwise.

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文