run .exe function?

Started by
6 comments, last by denethor 20 years, 6 months ago
In C++ on Windows, how can another application be started?
Advertisement
CreateProcess()

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

To start notepad you''d do "system("notepad.exe";"

#include <cstdlib>

using std::system;

system("program name");

--
Dave Mikesell
d.mikesell@computer.org
http://davemikesell.com
If you''re using windows, then ShellExecute() or CreateProcess() are usually better than std::system().
CreateProcess() or (preferably) CreateProcessEx(). system() can be used, but it''s blocking, which may or may not important for you.


"The sun is the same in a relative way,
but you''re older"
--Pink Floyd
blocking?
quote:Original post by Anonymous Poster
blocking?


"blocks" execution of the thread (/process) it''s called from until the work it''s doing finishes. i.e. system() doesn''t return until the application being executed has ended.

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

This topic is closed to new replies.

Advertisement