visual-studio 如何在 Visual Studio 6.0 或 Embedded VC++ (eVC) 中将对话框资源从一个项目复制到另一个项目?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/278085/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-22 09:53:21  来源:igfitidea点击:

How does one copy a dialog resource from one project to another in Visual Studio 6.0 or Embedded VC++ (eVC)?

visual-studioresource-files

提问by baash05

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

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

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.

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

回答by Roger Lipscombe

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

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

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

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

回答by Dave S

Update for Visual Studio 2010 - 2013:

Visual Studio 2010 - 2013 更新:

You can still drag-drop and copy-paste, but only outside ofyour 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."

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

Microsoft - How to Copy Resources

Microsoft -如何复制资源

回答by user12233103

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

我终于弄清楚如何将 Dialog 从一个解决方案复制到另一个解决方案。脚步:

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

回答by James Mahood

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.

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