Skip to main content
GameDev.net gamedev.net
🔒 Locked

Executing external programs

Started by quackface May 4, 2004 at 11:26 AM 7 replies 550+ views
Original Post
quackface
quackface
Hi people! Does enyone know how to launch an external program from a C++/MFC program. Basically, I''m trying to make a small, launcher program for a game I''m working on, which is just a dialog with a few buttons for launching different apps (i.e. a configuration tool and the game itself). Any ideas? Thanks
Arild Fines
Arild Fines
3 choices, basically(check MSDN for the docs):

* system()
* ShellExecute()
* CreateProcess()
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
Pipo DeClown
Pipo DeClown
I order you to use _exec(). Or some kind of it.

Know why? Because you''ll be SURE that the parameters are passed CORRECTLY, on any Windows version.

--
You''re Welcome,
Rick Wong

- sitting in his chair doing the most time-consuming thing..
T1mb0
T1mb0
exec-functions maybe wont do what the original poster wants, because they do not return.

Just Depends on the situation :-)

[edited by - T1mb0 on May 4, 2004 2:28:13 PM]
Pipo DeClown
Pipo DeClown
No really. I''ve been working on app/game launchers before. The parameters given did not work on Win98, and when I changed it, it didn''t work on WinXP. -_-''

So _exec()-functions REALLY are appropiate for launchers.

--
You''re Welcome,
Rick Wong

- sitting in his chair doing the most time-consuming thing..
Arild Fines
Arild Fines
quote:
Original post by Anonymous Poster
More than that. You could use WinExec()


Deprecated.
--AnkhSVN - A Visual Studio .NET Addin for the Subversion version control system.[Project site] [IRC channel] [Blog]
quackface
quackface
Cheers guys!!

I tried out _exec and it works like a charm!
Tested it on XP and 2000, and its good on both, but not had chance to try it on a 98 box (but do they exist anymore?)

Woohoo, It''s nearly ready to be released to the public!
flangazor
flangazor
quote:
Original post by quackface
but not had chance to try it on a 98 box (but do they exist anymore?)
Yes.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.