Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


integrating two vc++ projects(which use cdialog)

Posted on 2006-03-29
Medium Priority
Last Modified: 2013-11-20
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?
Question by:dharm0us
  • 5
  • 4
LVL 45

Assisted Solution

AndyAinscow earned 150 total points
ID: 16320828
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?

Author Comment

ID: 16321545
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.
LVL 45

Expert Comment

ID: 16321617
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?
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 22

Accepted Solution

mahesh1402 earned 150 total points
ID: 16322235
Opening resource files and copying dialog resources from existing to new one and write code accordingly will be better.


Author Comment

ID: 16341768
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:

LVL 45

Expert Comment

ID: 16341805
Just delete the .clw file.  When you run class wizard it will be rebuilt for you - much simpler than editing it yourself.

Author Comment

ID: 16341912
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.
LVL 45

Expert Comment

ID: 16341987
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.

Author Comment

ID: 16342344
yes, it works.
but why?
Is it because in the .h file of a given class,
I specify the dialog ID?
LVL 45

Expert Comment

ID: 16342373
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.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

575 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