Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS VC++ 6.0 application question 1

Status
Not open for further replies.

rdalton

Programmer
Dec 5, 2002
24
0
0
US
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.

See if this gets you wehre you need to be.

Matt
 
It's very simple -

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.

Good luck
 
Couldn't he just inherit the derived dialog class and overload the necessary functions? ( I think in more of an OO mindset. )
 
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.
:)
tellis.gif

[sup]programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.[/sup]​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top