Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problems making system calls

Status
Not open for further replies.

oinky

Programmer
Oct 29, 2001
45
US
Hi all, i am having problems making a system call to run notepad.exe. I did

system("notepad.exe");

this runs ok, but it pops up a dos window in the background which i do not know how to disable.

Ive tried using the _exec functions namely _execv and _execl, but they seem to not run. I am not sure if it is because _exec functions are c and mfc apps do not allow us to call these functions or what. My code for execl looks like this:

_execl ("notepad.exe", "notepad.exe","_execl", NULL);

please help thanks.
 
it works good thanks. But in the parameter where you put the file to run, it expects absolute path meaning i have to hardcode the path. I wonder if there is a way to use relative path? please help thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top