473,672 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

spawnvp does not work

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(in t option,char *argv[]);
int main(int ,char *argv[])
{
int option;
do
{
display_menu();
option=user_sel ection();
if (option!=7) //Exit
call_program(op tion,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",&op t);
return (opt);
}

void call_program(in t opt,char *argv[])
{
void delay();
switch(opt)
{
case 1:
spawnvp(0,"hell o1.exe",argv);
delay();
break;
case 2:
spawnvp(0,"hell o2.exe",argv);
delay();
break;
default:
printf("\n incoreect input");
delay();
exit(0);
}
}
void delay()
{
int i;
for (i=0;i<20000;i+ +);
}
Jul 22 '05 #1
3 2326
hp******@yahoo. com <eh***********@ yahoo.com> spoke thus:
I wrote that program but spawnvp dows not call the exe files hello1,hello2!! ! #include <stdio.h>
#include <conio.h>
#include <process.h>


(Unless someone else finds an on-topic answer...)

Your post is off-topic for comp.lang.c++. Please visit

http://www.slack.net/~shiva/welcome.txt
http://www.parashift.com/c++-faq-lite/

for posting guidelines and frequently asked questions. Thank you.

--
Christopher Benson-Manica | I *should* know what I'm talking about - if I
ataru(at)cybers pace.org | don't, I need to know. Flames welcome.
Jul 22 '05 #2
eh***********@y ahoo.com (hp******@yahoo .com) wrote in message news:<7e******* *************** ****@posting.go ogle.com>...
I wrote that program but spawnvp dows not call the exe files hello1,hello2!! !
[redacted]


What is this spawnvp of which you speak? It's not in my copy of the standard.

Try a windows specific newsgroup.
Jul 22 '05 #3
Did you try debugging and see what is happenning? Is the value you expect
getting to the switch statement? Do you get any error messags? You asked
this before, and I made these comments (and others) then. It was also
suggested that you ask in a newsgroup that knows what the heck spawnvp is.
The suggestions still stand.

-Howard
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
4846
by: Jonas | last post by:
This works fine in Win XP but does not work at all in Win 98. Private WithEvents objIExplorer As InternetExplorer I have to do it like this to get it to work in Win 98 Dim objIExplorer As InternetExplorer But then I cant see when a user exit my objIExplorer and than an error will show up when I try to open a link in the IE window that does not exist... What can I do about this and way does it not work in win 98?
5
3624
by: me | last post by:
I have a Class Library that contains a Form and several helper classes. A thread gets created that performs processing of data behind the scenes and the Form never gets displayed (it is for debug puposes only and is not normally visable to the user.) The Thread function is actually in the Form class. Now.. What I am seeing is that when I create an instance of this Class Library's Form, which starts the worker thread, it seems to hose up...
2
419
by: hpy_awad | last post by:
#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) {
2
312
by: hpy_awad | last post by:
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);
22
2610
by: Robert Bralic | last post by:
CAN anybody tell me any address where I can download some small(1000-2000) lines C++ proghram source. Or send me ,a small(1000-2000) lines C++ program source that I can compille with gpp under Linux Suse 7.1. I can't belive that C++ exists. Thanks in advance ! robert.bralic@si.htnet.hr
12
2938
by: Frank Hauptlorenz | last post by:
Hello Out there! I have a DB2 V7.2 Database (Fix11) on Win 2000 Professional. It was before a NT 4 based Domain - now it is a Win 2000 Domain. The database server is a domain member. Now sometimes Win 2000 Clients can't connect to the database. They connect over TCP/IP. The db2log says that the function getHostByName failed. It seems to be only on new installed win 2000 Workstations. Already installed WS have NOT this problem.
0
2363
by: Jarod_24 | last post by:
How does tabindex work in ASP .net pages I dosen't seem to work quite like in regular forms. and there isn't any TabStop property either. 1 .How do you prevent a control form beign "tabbed". (hidden textboxes ect.) 2. How do get a control to get focus when the page is loaded (think username textfield on a loginpage) 3. Does the tab-order work just like in regular forms (1 ->2 -> 3 and so on?) 4. How does tabindex work with datagrid...
14
4842
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it can be done using the designer but I intentionally don't want to use that. The one reason is that you cannot change the code generated by the designer. The other could be that you have more free hand and control to design your GUI. 2....
89
6035
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be used." Could anybody tell me why gets() function is dangerous?? Thank you very much. Cuthbert
14
3476
by: webEater | last post by:
I have a problem, it's not browser specific, and I don't get a solution. I have an (X)HTML document, I show you a part of it: .... <!--<div class="pad">--> <div id="eventImages"><img src="" id="eventImage0" class="eventImage"><img src="" id="eventImage1" class="eventImage"></div>
0
8932
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8832
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8686
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6240
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4424
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2821
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1821
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.