about spawnl

This is a discussion on about spawnl within the C Programming forums, part of the General Programming Boards category; 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 ...

  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 10: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, 09:00 PM
  3. using spawnl for a dos program
    By ronin in forum C Programming
    Replies: 6
    Last Post: 06-30-2002, 10:34 PM
  4. spawnl !!!
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 06-05-2002, 07:00 PM
  5. spawnl and char *
    By lsegundo in forum C Programming
    Replies: 9
    Last Post: 02-26-2002, 05:01 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21