Running C++ program in the background

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Jul 2007
Posts: 126
Reputation: krnekhelesh is an unknown quantity at this point 
Solved Threads: 3
krnekhelesh's Avatar
krnekhelesh krnekhelesh is offline Offline
Junior Poster

Running C++ program in the background

 
0
  #1
Oct 17th, 2007
I am making this program which checks if your floppy drive is ready or not. And so it has to check for say 20 seconds. And for this I want the program to run in the background. How do I do this?

I am using Borland C++ and Turbo C++
Ubuntu Linux User #25732
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,848
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 754
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: Running C++ program in the background

 
0
  #2
Oct 17th, 2007
What operating system?

[edit]
For rep happy the morons who can't tell the difference, I'm asking if the OP is using Windows or DOS. The answer to the question changes drastically between those two systems, and Borland has written C++ compilers for them both.
[/edit]
Last edited by Narue; Oct 17th, 2007 at 5:19 pm.
New members chased away this month: 4
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 126
Reputation: krnekhelesh is an unknown quantity at this point 
Solved Threads: 3
krnekhelesh's Avatar
krnekhelesh krnekhelesh is offline Offline
Junior Poster

Re: Running C++ program in the background

 
0
  #3
Oct 21st, 2007
I want it to be a DOS based program. I have borland C++ the windows based.
Ubuntu Linux User #25732
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 126
Reputation: krnekhelesh is an unknown quantity at this point 
Solved Threads: 3
krnekhelesh's Avatar
krnekhelesh krnekhelesh is offline Offline
Junior Poster

Re: Running C++ program in the background

 
0
  #4
Oct 21st, 2007
But is it possible to run a C++ program in the background????
Ubuntu Linux User #25732
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 4,461
Reputation: Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future Dave Sinkula has a brilliant future 
Solved Threads: 253
Team Colleague
Dave Sinkula's Avatar
Dave Sinkula Dave Sinkula is offline Offline
long time no c

Re: Running C++ program in the background

 
0
  #5
Oct 21st, 2007
Originally Posted by krnekhelesh View Post
I want it to be a DOS based program. I have borland C++ the windows based.
The question is whether or not DOS is your operating system. Don't confuse a console application in Windows with being "DOS". Which, given your reply, is a likely assumption.

On what OS do you intend to run the target executable?
Last edited by Dave Sinkula; Oct 21st, 2007 at 1:18 am.
"One of the methods used by statists to destroy capitalism consists in establishing controls that tie a given industry hand and foot, making it unable to solve its problems, then declaring that freedom has failed and stronger controls are necessary." --Ayn Rand
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 126
Reputation: krnekhelesh is an unknown quantity at this point 
Solved Threads: 3
krnekhelesh's Avatar
krnekhelesh krnekhelesh is offline Offline
Junior Poster

Re: Running C++ program in the background

 
0
  #6
Oct 21st, 2007
got it... Windows XP
Ubuntu Linux User #25732
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,639
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1497
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Running C++ program in the background

 
0
  #7
Oct 21st, 2007
You would have to write a TSR (terminate-and-stay-resident), and I'm not sure that cmd.exe supports that like it did with MS-DOS Version 6.X and earlier.

I thought you might use one of the win32 hooks, but probably not from what I read.

Possibly a device driver or a windows service program
Last edited by Ancient Dragon; Oct 21st, 2007 at 7:23 am.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 1,861
Reputation: ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all ithelp is a name known to all 
Solved Threads: 120
ithelp's Avatar
ithelp ithelp is offline Offline
Posting Virtuoso

Re: Running C++ program in the background

 
0
  #8
Oct 21st, 2007
You have to write it as a window service.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 87
Reputation: prushik is on a distinguished road 
Solved Threads: 4
prushik prushik is offline Offline
Junior Poster in Training

Re: Running C++ program in the background

 
0
  #9
Oct 21st, 2007
im pretty sure that it isnt exactly the right way to do it, or the best way, but i know an easy way to run a c++ program in the background.

Make it a win32 application instead of console but do not draw a window.

I know it works, ive done it before.

again, i know its not a good way to do it, but it will work.
Reply With Quote Quick reply to this message  
Join Date: Jul 2007
Posts: 126
Reputation: krnekhelesh is an unknown quantity at this point 
Solved Threads: 3
krnekhelesh's Avatar
krnekhelesh krnekhelesh is offline Offline
Junior Poster

Re: Running C++ program in the background

 
0
  #10
Oct 24th, 2007
thanks for the help..
Ubuntu Linux User #25732
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 5717 | Replies: 10
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC