Last Modification: December 11, 1999

How can I copy a dialog resource from one project to another?

There are two ways of doing it: 

  1. You can copy the resource directly. Open the .rc files from both projects in VC++ as text files, or open them in your favorite text editor, and copy the relevant bits from one to another. You can spot the portion of the file you need to copy by looking for the section where the dialog resource is defined, which will be something along the lines of:

    IDD_MYDIALOG_ID DIALOG DISCARDABLE 0, 0, 235, 55

    where IDD_MYDIALOG_ID is the id of your dialog. Copy the full thing until the END statement. You'll also need to add the dialog id to the new project, either by using DevStudio's facilities for doing so, or by directly editing resource.h.

  2. You can use DevStudio's copy/paste facilities. First, open both .rc files in the editor, in "auto" mode, so the resource are displayed normally. Then, select the ID of the dialog resource you want to copy and select Edit -> Copy from the menu, or press Ctrl-C. Then go to the target resource file, and paste there, either by selecting Edit -> Paste from the menu, or by pressing Ctrl-V.