integrating two vc++ projects(which use cdialog)

Say I have two vc++ projects using MFC. Both of the applications when launched, show a dialog.
Now, If I want to integrate them in the following manner:
(1) I should be able to combine them in a single vc++ project,
     so that I have only one exe.
(2) I should be able to launch any of the above applications
     from a third dialog, in the same project.

How can it be done?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AndyAinscowFreelance programmer / ConsultantCommented:
Two methods spring to mind.
Copy/Paste the resources and code you want into a new project so you have the functionality of both current apps but within one exe.
OR more simply create a third exe that works with the existing ones.
Create a new project that launches either of the existing apps (eg. ShellExecute, CreateProcess).

Which sounds most interesting?
dharm0usAuthor Commented:
I tried that.
Here is what I did:
I merged the two *.rc files and resource.h files(not simply copy-pase, but a careful merge), and included the *.cpp and *.h files in the new project. but the project even failed to load, when I tried to open it.
and then when I tried to compile it, it gave an error like:
cannot write to *.pch file due to insufficient system resources.

as for the second option, we can assume it's not allowed. I need only one exe.
AndyAinscowFreelance programmer / ConsultantCommented:
The pch is the pre-compiled header file.  You can safely delete it (in fact a rebuild all should delete it without you having to).

Just try a rebuild all on the project.  Does that help in any way?
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

Opening resource files and copying dialog resources from existing to new one and write code accordingly will be better.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dharm0usAuthor Commented:
yeah, here is a final comment by me.
anyone who wishes to do such a thing, should do this:
"carefully" merge thse files:
1. *.clw for both the projects.
2. resource.h for both the projects.
3. *.rc for both the projects

In *.clw you will have to yourself edit
ClassCount = ..

while modifying resource.h, you will have to assign the different numbers manually, in the increasing order and you will also have to edit, thse two:

AndyAinscowFreelance programmer / ConsultantCommented:
Just delete the .clw file.  When you run class wizard it will be rebuilt for you - much simpler than editing it yourself.
dharm0usAuthor Commented:
I am not sure about this.
Since .clw file is the only place where you can specify
which dialog uses which class.
If you don't copy that information from the other .clw file,
you will have to specify in class wizard which class do you want to associate with each dialog.
AndyAinscowFreelance programmer / ConsultantCommented:
OK, try this.
Make a copy of your project.
In the original delete the .clw file.
Start VC.
Start the class wizard.
see what happens.
dharm0usAuthor Commented:
yes, it works.
but why?
Is it because in the .h file of a given class,
I specify the dialog ID?
AndyAinscowFreelance programmer / ConsultantCommented:
The clw file is a file the class wizard builds from information in the other files in the project.  It is to help the class wizard and its contents are updated as you make changes to the other files in the project.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.