🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.tools.mfc
Article #88

spawnvp still does not work

#88
From: hpy_awad
Date: Tue, 27 Apr 2004 10:15
66 lines
2076 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.0404270215.69123ef8@posting.google.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1138df,849b6cbe3bfc9622,start
X-Google-Thread: 114592,a88c2c65285add14,start
X-Google-Thread: fa69e,afaff6b21cfb08a9,start
X-Google-Attributes: gid1138df,gid114592,gidfa69e,public
X-Google-ArrivalTime: 2004-04-27 03:15:31 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 still does not work
Date: 27 Apr 2004 03:15:31 -0700
Organization: http://groups.google.com
Lines: 66
Message-ID: <7ecaee57.0404270215.69123ef8@posting.google.com>
NNTP-Posting-Host: 62.135.9.240
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1083060931 5571 127.0.0.1 (27 Apr 2004 10:15:31 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 27 Apr 2004 10:15:31 +0000 (UTC)