Launching an application

Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Nov 2008
Posts: 8
Reputation: monere is an unknown quantity at this point 
Solved Threads: 0
monere monere is offline Offline
Newbie Poster

Launching an application

 
0
  #1
Jan 3rd, 2009
Hello,

I am a new beginner to c++. I am trying to launch an application in using the following command:

system("clip100.txt")

File clip100.txt got opened on my word processing software running and i had to exit from word processing to get my program continued.

My question is: How can i get my file clip100.txt ( or similar with different format, ex mp4) opened and allowing my application program to continue running passed the system("clip100.txt") line.

I was told about a command "Createprocess" but i cannot find documentation about it.

My purpose is to visually observe the opened file( txt, mp4 movie) while the my application program is prompting me with different inputs request i have to answer.

Thank you

monere.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 671
Reputation: Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough 
Solved Threads: 113
Freaky_Chris's Avatar
Freaky_Chris Freaky_Chris is offline Offline
Practically a Master Poster

Re: Launching an application

 
0
  #2
Jan 3rd, 2009
Knowledge is power -- But experience is everything
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 117
Reputation: u8sand is on a distinguished road 
Solved Threads: 15
u8sand's Avatar
u8sand u8sand is offline Offline
Junior Poster

Re: Launching an application

 
0
  #3
Jan 3rd, 2009
Originally Posted by monere View Post
Hello,

I am a new beginner to c++. I am trying to launch an application in using the following command:

system("clip100.txt")

File clip100.txt got opened on my word processing software running and i had to exit from word processing to get my program continued.

My question is: How can i get my file clip100.txt ( or similar with different format, ex mp4) opened and allowing my application program to continue running passed the system("clip100.txt") line.

I was told about a command "Createprocess" but i cannot find documentation about it.

My purpose is to visually observe the opened file( txt, mp4 movie) while the my application program is prompting me with different inputs request i have to answer.

Thank you

monere.

Well, u shouldent really use system(...)

but thats the easiest way as a begginner

so do this:

  1. system("start clip100.txt");

system()
is like calling the command prompt and typing in so i recomend you go to start->run -> cmd.exe
in that type in help
press enter and you will get a bunch of commands
with every command type the command and /?
to get info on how to use that command.

You can use the command in the program using system("...");

Hope that helps : )
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: Launching an application

 
0
  #4
Jan 3rd, 2009
  1. #include <windows.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. ShellExecute(NULL, "open", "C:\\cool.txt","", "C:\\", SW_NORMAL);
  8. return 0;
  9. }
Last edited by Comatose; Jan 3rd, 2009 at 12:52 pm.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 8
Reputation: monere is an unknown quantity at this point 
Solved Threads: 0
monere monere is offline Offline
Newbie Poster

Re: Launching an application

 
0
  #5
Jan 3rd, 2009
Comatose,

I tried your solution. it worked perfectly the first try.
I will check documentation to gain a better understanding of the Shellexecute "functions".

I also thank other members of this forum who provided me with interesting answers and insight to the problem i was facing.
Thanks a lot

Monere
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 322 | Replies: 4
Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC