Which function is better for launching external application?

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

Join Date: Jan 2009
Posts: 2
Reputation: sydetys is an unknown quantity at this point 
Solved Threads: 0
sydetys sydetys is offline Offline
Newbie Poster

Which function is better for launching external application?

 
0
  #1
Jan 3rd, 2009
HEADER;
I am noob in programming, so keep it simple thank you

I use VS 2008 pro SP1
OS is vista Ultimate x64 SP1...(SP2 beta I will try later)

Which function is better and what are differences?

1. system ()
2. CreateProcess ()

...is there more choices?

My goal is just experiment windows coding, various things, and launcher-type program popped in my mind.

Those external applications would be example like CCleaner.exe and...defrag.exe in OS. So I would run them from single launcher.
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Which function is better for launching external application?

 
0
  #2
Jan 3rd, 2009
Use CreateProcess()
It's the one native to your OS, and will ultimately give you the most control over what happens.

Use system() if you require no more sophistication than would be provided by a batch file. In other words, very basic "run & forget" approach.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 2
Reputation: sydetys is an unknown quantity at this point 
Solved Threads: 0
sydetys sydetys is offline Offline
Newbie Poster

Re: Which function is better for launching external application?

 
0
  #3
Jan 3rd, 2009
okey dokey

CreateProcess it will be


thanx
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: Which function is better for launching external application?

 
0
  #4
Jan 3rd, 2009
Indeed createprocess is the much better choice, it gives you much more control over the outcome of everything.

BTW: IF it's solved could you please mark the thread as solved

Thanks,
Chris
Knowledge is power -- But experience is everything
Reply With Quote Quick reply to this message  
Reply

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



Other Threads in the C++ Forum


Views: 421 | Replies: 3
Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC