baash05
baash05

Reputation: 4516

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

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.

Upvotes: 7

Views: 13784

Answers (5)

MNS
MNS

Reputation: 1394

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

Upvotes: 0

user12233103
user12233103

Reputation: 1

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

Upvotes: 0

Dave S
Dave S

Reputation: 1502

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

Upvotes: 5

James Mahood
James Mahood

Reputation: 11

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.

Upvotes: 0

Roger Lipscombe
Roger Lipscombe

Reputation: 91885

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

Upvotes: 5

Related Questions