Thread: about spawnl

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    5

    about spawnl

    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.

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    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:
    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);
    }
    [edit]Note I called the child process temp.exe in this example[/edit]
    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]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems with spawnl()
    By Mr.Modem in forum C Programming
    Replies: 11
    Last Post: 02-11-2006, 08:37 AM
  2. spawnl()
    By Drew53385 in forum C++ Programming
    Replies: 1
    Last Post: 10-23-2002, 08:00 PM
  3. using spawnl for a dos program
    By ronin in forum C Programming
    Replies: 6
    Last Post: 06-30-2002, 09:34 PM
  4. spawnl !!!
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 06-05-2002, 06:00 PM
  5. spawnl and char *
    By lsegundo in forum C Programming
    Replies: 9
    Last Post: 02-26-2002, 05:01 PM