Link to home
Start Free TrialLog in
Avatar of tpresenza
tpresenza

asked on

Execute program from visual c program

I have developed a visual c ++ program as a standard .exe and I need to have it execute/run another program that is a standard .exe.  I am having problems finding the correct code to accomplish this.
ASKER CERTIFIED SOLUTION
Avatar of AaronReams
AaronReams

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AaronReams
AaronReams

btw, you can also use _spawn
Here's an example of using ShellExecute to call the external application "regsvr32.exe" and pass it a parameter of "tip.dll"...

 ::ShellExecute(NULL, NULL, _T("regsvr32.exe"), _T("tip.dll"), NULL, SW_SHOW);
Here's how to use _spawnl....

spawnl(_P_NOWAIT,"C:\\Program Files\\Plus!\\Microsoft Internet\\IEXPLORE.EXE",NULL);

and the last method you can use is WinExec... but that has been deprecated.
Avatar of tpresenza

ASKER

Aaron,

Thanks.  I'll give it a try.

tpresenza