Such as:
spawnl(P_WAIT,"test.exe",NULL);
In DOS,I design a program--main.exe; in a menu,I want to run test.exe and return main.exe.but,now,when the test.exe finished,it cann't return main.exe.
What can I do?
thanks!
ps:my english is poor.
Such as:
spawnl(P_WAIT,"test.exe",NULL);
In DOS,I design a program--main.exe; in a menu,I want to run test.exe and return main.exe.but,now,when the test.exe finished,it cann't return main.exe.
What can I do?
thanks!
ps:my english is poor.
You have a parameter missing. Try
>spawnl(P_WAIT,"test.exe","test.exe",NULL);
Is test.exe definately being run?
Try this code, and see if it works:
[edit]Note I called the child process temp.exe in this example[/edit]Code:#include <stddef.h> #include <process.h> #include <stdio.h> int main(void) { printf ("Before\n"); spawnl(P_WAIT,"temp.exe", "temp.exe", NULL); printf ("After\n"); return (0); }
Last edited by Hammer; 05-13-2002 at 09:06 AM.
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]