Computing.Net > Forums > Programming > C++ system() controlling called app

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

C++ system() controlling called app

Reply to Message Icon

Name: neal
Date: July 23, 2008 at 11:33:52 Pacific
OS: win XP pro sp3
CPU/Ram: athlonx2 6000+/4GB
Product: home build
Comment:

Hi,
I'm trying to write a program in C++ using VS 2008 that will do some file processing, then call a program called scip (http://scip.zib.de/) and get scip to use a temporary file I have generated. The problem I am having is that once my program has called scip, scip then 'takes control' of the window; when I do this:

string scip ("C:\\zimpl\\scip\\scip.exe");
system(scip.c_str());
cout<<"read\"stableset.lp\""<<"\n";

the line sent by cout doesnt appear until I type 'quit' and scip returns control back to my program, which then dumps 'read"stableset.lp"' on the screen. I don't know if it's relevant or not,but when you run scip in the command prompt, the prompt changes from 'C:\zimpl\scip>' to SCIP\>
If anyone knows how I can then send commands to scip using my C++ program I'd be very grateful. Thank you.



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: July 24, 2008 at 02:46:59 Pacific
Reply:

The problem I am having is that once my program has called scip, scip then 'takes control' of the window
That's how system() works, yes.

get scip to use a temporary file I have generated
Does this 'scip' have a command-line argument to specify this temporary file?

If anyone knows how I can then send commands to scip using my C++ program
If it uses stdin, I can throw up an example, but it's kind of a pain.


1

Response Number 2
Name: neal
Date: July 24, 2008 at 04:12:16 Pacific
Reply:

Hi, you can't start up scip with an argument unfortunately, you have to enter commands. I actually need to send it the following:

read"stableset.lp"
optimize
display results

as three separate commands. Is there a way to do that? Do I perhaps need to start a separate thread?
Thanks


0

Response Number 3
Name: neal
Date: July 24, 2008 at 09:04:55 Pacific
Reply:

Have found a way round this now (using scip), thanks for your help.


-1

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: C++ system() controlling called app

Help with C++ SYSTEM STUFF www.computing.net/answers/programming/help-with-c-system-stuff/7052.html

Visual C++ System() pwd??? www.computing.net/answers/programming/visual-c-system-pwd/5934.html

c++ - system() question www.computing.net/answers/programming/c-system-question/16524.html