Article View: comp.os.ms-windows.programmer.tools.mfc
Article #90spawnvp does not work
From: hpy_awad
Date: Sat, 17 Apr 2004 00:02
Date: Sat, 17 Apr 2004 00:02
65 lines
2125 bytes
2125 bytes
I wrote that program but spawnvp dows not call the exe files hello1,hello2!!!
#include <stdio.h>
#include <conio.h>
#include <process.h>
//Tv Rental system menu version 1
int user_selection();
void display_menu();
void call_program(int option,char *argv[]);
int main(int ,char *argv[])
{
int option;
do
{
display_menu();
option=user_selection();
if (option!=7) //Exit
call_program(option,argv);
}
while (option!=7);
return 0;
}
void display_menu()
{
clrscr();
printf("1 hello1");
printf("\n2 hello2");
printf("\n3 exit");
}
int user_selection()
{
int opt;
printf("\n Enter required option(1-3) : ");
scanf("%1d",&opt);
return (opt);
}
void call_program(int opt,char *argv[])
{
void delay();
switch(opt)
{
case 1:
spawnvp(0,"hello1.exe",argv);
delay();
break;
case 2:
spawnvp(0,"hello2.exe",argv);
delay();
break;
default:
printf("\n incoreect input");
delay();
exit(0);
}
}
void delay()
{
int i;
for (i=0;i<20000;i++);
}
Technical Details
Message-ID:
<7ecaee57.0404161602.525f7bec@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1138df,d0fc32548bb83a0a,start X-Google-Attributes: gid1138df,public X-Google-Thread: 114592,d0fc32548bb83a0a,start X-Google-Attributes: gid114592,public X-Google-Thread: fa69e,d0fc32548bb83a0a,start X-Google-Attributes: gidfa69e,public X-Google-ArrivalTime: 2004-04-16 17:02:14 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail From: ehab_aziz2001@yahoo.com (hpy_awad@yahoo.com) Newsgroups: comp.os.ms-windows.programmer.tools.mfc,alt.comp.lang.learn.c-c++,borland.public.cpp.borlandcpp Subject: spawnvp does not work Date: 16 Apr 2004 17:02:13 -0700 Organization: http://groups.google.com Lines: 65 Message-ID: <7ecaee57.0404161602.525f7bec@posting.google.com> NNTP-Posting-Host: 213.212.222.8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1082160134 28535 127.0.0.1 (17 Apr 2004 00:02:14 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 17 Apr 2004 00:02:14 +0000 (UTC)