I'm trying to copy a dialog from one project to another, so I don't have to lay it out again. Is there anyway to do this? I've exported other resources (ie bitmaps), but I can't figure out how to transfer the dialogs. Thanks.
Dialogs are a bit trickier and I have never done this but I can assume this is the approach.
Here is how I "ASSUME" it should work
1. In the new project, create the dialog with the same name
2. Save the project.
3. Open the current project .rc file as text (this will close all dialog windows you currently have open so save all if necessary)
4. Open the old .rc file as text
5. Copy everything inbetween the BEGIN & END tags of the old dialog you want
6. Paste it into the new .rc file in the appropriate area.
7. In the old code, there is another location where the dialog is described. I dont know if this will be require or not but I think it will. If I remember correctly, this area may have size descriptions in it. Just search on the dialog name and you will find it.
Because we added the dialog first, the resource.h file should be updated.
Step 1 - Open your new project and click on the resource tab of the workspace window
Step 2 - Do a File-Open of the *.rc file in the old project workspace. If you do this correctly, you will see resource windows on both sides of your screen. The left side will be your old project resources and the right side will be your new project resources.
Step 3 - Click on the old resource window's Dialog icon so you can see all your old project's dialogs.
Step 4 - Left click and hold the individual dialog item you want to add to your new project. While holding down the left mouse button, drag the individual dialog's entry to the new project's Dialog icon. Release the left mouse button over the new project's Dialog icon and you're all set. A simple drag-and-drop operation.
There's actually a much simpler way: just select the dialog required in the resource view and 'copy'. Then, open the new project, select any resource in the resource view and choose 'paste'.
Note, you have to make a selection in the resource view for these menu commands to be available but I do this all the time when reusing resources.
[sup]programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.[/sup]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.