How to copy dialogs from one project to another in Visual Studio

Posted on 2004-04-22
Last Modified: 2010-04-24

I am relatively new to VC++. I am not even sure if the question is right under this channel. Pl help me out.

I have a project where there are some dialogs with some BMPs and Icons. I need to move those dialogs to another project , so that i need not redo the entire GUI again. How to go about that? I also have corresponding C++ files for those dialogs. So i need to import the entire thing to different project.

pl help me out.

Question by:rampriya_sb
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 48

Accepted Solution

AlexFM earned 500 total points
ID: 10896689
There is no problem to move dialog .cpp and .h files to another project. To move dialog resource, you need to see both source and destination resources in the same instance of Visual Studio.

1) Open destination project in Visual Studio
2) Open source .rc file using command "File - Open" (open automatically as resource)
3) Having destination resoures opened in Workspace pane and source resources opened as file, you can use copy-paste or drag-and-drop to move dialog template from one resource file to another.
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11188679
You can move safely your dialog resource opening your .rc file as a text (even with a text editor), locate dialogs section, all is in text mode, like this:

CAPTION "My Dialog sample"
FONT 8, "MS Sans Serif"
    DEFPUSHBUTTON   "OK",1,11,116,40,14
    PUSHBUTTON      "Cancel",2,61,116,40,14
    PUSHBUTTON      "Help",204,110,116,40,14
    LTEXT           "The List:",IDC_STATIC,11,8,34,8
    LISTBOX         110,11,23,138,83,LBS_SORT | LBS_NOINTEGRALHEIGHT |
                    WS_VSCROLL | WS_TABSTOP

copy the entire dialog's corresponding text and pasto into the new project .rc dialog. Does not matters if new project is in Visual C++ 4,5,6,.NET,or Embedded!
After that open you project in Visual Studio
LVL 48

Expert Comment

ID: 11189703
1) The last post is wrong because it doesn't solve the problem of resource IDs in resource.h file
2) The goal of answering the abandonded question (more than month from answer date) is to get splitted points at cleanup.
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

LVL 55

Expert Comment

by:Jaime Olivares
ID: 11191067
1) I am sure you have the answer for your first comment: You have to create an ID for IDD_MYDIALOG in your project.
I use this technique frequently because I have developed several multi-platform systems with Visual C++/embedded Visual C++.
2) If a question remains opened for a month, maybe your answer is not satisfactory.

LVL 48

Expert Comment

ID: 11191511
There are some "fair play" agreements between experts. New experts sometimes break them, but in most cases they learn them after some time.
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11191567
My answer is totally different from yours, so I think I am fair playing, but if that will make you happy, I don't want the points. I can gift all my points too if you want, only you have to talk with the editors and I will accept.

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
In Easy String Encryption Using CryptoAPI in C++ ( I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question