Improve company productivity with a Business Account.Sign Up

x
?
Solved

How to add 2 project together for compile and make as one.

Posted on 2006-07-10
6
Medium Priority
?
246 Views
Last Modified: 2013-11-20
Under the same workspace, there are 2 projects A and B. Currently, we compile A and B separately. Run A first, A dumps its result to a file in hard disk. Then, run B and B get input from a file from hard disk(this file is either the one porject A created or from somewhere else.)
 
Now, want to compile and run these 2 projects together following any of the following sequences.
 
1. Compile A & B together, then automatically run A, then B (A created a file in hard disk and B get input from the file A created)
2. Compile A & B together, then run B only (input from a file with known file name from hard disk).
 
A command line parameter is used to choose any of the above 2 running sequences.
 
Do I need to merge the 2 projects together? (it is very big, a lot of files involved, there are a lot of variables to be renamed since the same names appear in both projects,will cost a lot of time)
 
Any easy way?
Thanks
0
Comment
Question by:turbot_yu
  • 3
  • 2
6 Comments
 
LVL 45

Assisted Solution

by:AndyAinscow
AndyAinscow earned 1400 total points
ID: 17072581
Keep them as separate projects and create batch files to do the processing that you require.
0
 

Author Comment

by:turbot_yu
ID: 17072729
how to set the parameter of the batch file?
0
 
LVL 45

Accepted Solution

by:
AndyAinscow earned 1400 total points
ID: 17072797
eg. batch file - RunB.bat

x:\SomePath\Release\B.exe "PathToFile.txt"


To compile a project - CompileB.bat

devenv x:\SomePath\B.sln /build "Release"
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

 

Author Comment

by:turbot_yu
ID: 17073412
how to detect whether the txt file is ready in batch file.
0
 
LVL 22

Assisted Solution

by:mahesh1402
mahesh1402 earned 600 total points
ID: 17075038
you may also write small program code to perform this 'Automation'..if you need to programatically detect if text file is ready or not....

You may use SHellExecute() / CreateProcess() for your purpose to execute command lever compiler options..

1) Compile and execute 'A' with ShellExecute()

2) wait in loop for creation of text file ( e.g by detecting if file is ready to open in read mode..)

3) Compile and Run B by taking input from generated text file.

You may refer samples how to use ShellExecute :
http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_21634002.html

-MAHESH

0
 
LVL 45

Assisted Solution

by:AndyAinscow
AndyAinscow earned 1400 total points
ID: 17076370
<how to detect whether the txt file is ready in batch file.>

When 'A' finishes writing the text file then it could start 'B' (eg. by CreateProcess) - no need for another app in that case.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

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.

Join & Write a Comment

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Watch the video of Kernel Migrator for SharePoint, which demonstrate the process easily of migration from SharePoint to SharePoint, OneDrive for Business & Google Drive servers, Public Folder to SharePoint, File Server to SharePoint. The tool has va…

607 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