473,549 Members | 2,346 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I Need help with a command

I want to run a program from the program im writing. For example when
my program is running I want it to open up an internet explorer window.
I have been searching and found that there is a RUN command, it won't
run with any library that I know. so what i am asking for is a way to
call other programs, or the header file nescarrary to use the RUN
command.

Jul 23 '05 #1
10 3726
sa***********@g mail.com wrote:
I want to run a program from the program im writing. For example when
my program is running I want it to open up an internet explorer
window. I have been searching and found that there is a RUN command,
it won't run with any library that I know. so what i am asking for
is a way to call other programs, or the header file nescarrary to use
the RUN command.


Post this to 'comp.os.ms-windows.program mer.win32'. They will help you
with available means of starting another process in Windows.

V
Jul 23 '05 #2
Victor Bazarov wrote:
sa***********@g mail.com wrote:
I want to run a program from the program im writing. For example when
my program is running I want it to open up an internet explorer
window. I have been searching and found that there is a RUN command,
it won't run with any library that I know. so what i am asking for
is a way to call other programs, or the header file nescarrary to use
the RUN command.

Post this to 'comp.os.ms-windows.program mer.win32'. They will help you
with available means of starting another process in Windows.

V


The system(const char *) function is available in cstdlib. Look at the
following code:

ken@ken-wn0vf73qmks ~/c
$ cat run.cpp
#include <cstdlib>
#include <cstdio>

int main(int argc, char **argv) {
if(argc == 2) system(argv[1]);
else printf("Usage: %s [program-name]\n", argv[0]);
return 0;
}

ken@ken-wn0vf73qmks ~/c
$ ./run ./test
1: Hello!, 2: Hello!, 3: Hello!
Hi12345, Hello!
Jul 23 '05 #3

"Ken Human" <ke******@comca st.net> wrote in message
news:fN******** ************@co mcast.com...
Victor Bazarov wrote:
sa***********@g mail.com wrote:
I want to run a program from the program im writing. For example when
my program is running I want it to open up an internet explorer
window. I have been searching and found that there is a RUN command,
it won't run with any library that I know. so what i am asking for
is a way to call other programs, or the header file nescarrary to use
the RUN command.

Post this to 'comp.os.ms-windows.program mer.win32'. They will help you
with available means of starting another process in Windows.

V


The system(const char *) function is available in cstdlib. Look at the
following code:


Its not a function, its a macro and its not c++ either. So you are off
topic.

Redirecting the OP to the appropriate newsgroup is beneficial for both the
users here and the OP. For example, in this specific case, cstdlib's system
macro isn't the recommended way to launch that application and the
executable in question is not found in the windows environment path.

ken@ken-wn0vf73qmks ~/c
$ cat run.cpp
#include <cstdlib>
#include <cstdio>

int main(int argc, char **argv) {
if(argc == 2) system(argv[1]);
else printf("Usage: %s [program-name]\n", argv[0]);
return 0;
}

ken@ken-wn0vf73qmks ~/c
$ ./run ./test
1: Hello!, 2: Hello!, 3: Hello!
Hi12345, Hello!

Jul 23 '05 #4
codigo wrote:
"Ken Human" <ke******@comca st.net> wrote in message
news:fN******** ************@co mcast.com...
Victor Bazarov wrote:
sa********** *@gmail.com wrote:
I want to run a program from the program im writing. For example when
my program is running I want it to open up an internet explorer
window. I have been searching and found that there is a RUN command,
it won't run with any library that I know. so what i am asking for
is a way to call other programs, or the header file nescarrary to use
the RUN command.
Post this to 'comp.os.ms-windows.program mer.win32'. They will help you
with available means of starting another process in Windows.

V
The system(const char *) function is available in cstdlib. Look at the
following code:

Its not a function, its a macro


Cygwin declares system as:
#define _EXFUN(name, proto) __cdecl name proto
int _EXFUN(system,( const char *__string));

The latest MSVS.NET declares it as:
_CRTIMP int __cdecl system(const char *);

Those are some odd looking macros. If you're interested in the
definitions for these functions, I can accommodate.

and its not c++ either. So you are off topic.

Last I checked, cstdlib was a standard C++ header.

Redirecting the OP to the appropriate newsgroup is beneficial for both the
users here and the OP. For example, in this specific case, cstdlib's system
macro isn't the recommended way to launch that application and the
executable in question is not found in the windows environment path.


Redirecting the OP didn't answer his question. He was asking about a
RUN() function and was most likely talking about system().
Jul 23 '05 #5
Ken Human wrote:
Redirecting the OP didn't answer his question. He was asking about a
RUN() function and was most likely talking about system().


If it is not standard c++ language, then redirecting to proper newsgroup
is much better response. He is likely to get more correct answer from
that 'dedicated' group.

Krishanu

Jul 23 '05 #6
codigo wrote:
Its not a function, its a macro and its not c++ either. So you are off
topic.

From C90 which applies in C++98 too:

4.10.4.5 The system function

Synopsis

#include <stdlib.h>
int system(const char *string);

Description

The system function passes the string pointed to by string to the host environment to be
executed by a command processor in an implementation-defined manner. A null pointer may be
used for string to inquire whether a command processor exists.

Returns

If the argument is a null pointer, the system function returns nonzero only if a command
processor is available. If the argument is not a null pointer, the system function returns
an implementation-defined value."
In other words it is not a macro.
For example, in this specific case, cstdlib's system
macro
function

isn't the recommended way to launch that application
Why?

and the
executable in question is not found in the windows environment path.

Are you talking about Internet Explorer?
--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #7
Krishanu Debnath wrote:
Ken Human wrote:
Redirecting the OP didn't answer his question. He was asking about a
RUN() function and was most likely talking about system().

If it is not standard c++ language, then redirecting to proper newsgroup
is much better response. He is likely to get more correct answer from
that 'dedicated' group.

Krishanu


Check your standard. App 3.2.7. It clearly claims system() as a
standard C++ function. Context around this subclause clearly states
that system() is indeed a function, not a macro.
Jul 23 '05 #8

"codigo" <co****@codigo. trap.com> wrote in message
news:FW******** ***********@new s20.bellglobal. com...
|
| "Ken Human" <ke******@comca st.net> wrote in message
| news:fN******** ************@co mcast.com...
| > Victor Bazarov wrote:
| > > sa***********@g mail.com wrote:
| > >
| > >>I want to run a program from the program im writing. For example when
| > >>my program is running I want it to open up an internet explorer
| > >>window. I have been searching and found that there is a RUN command,
| > >>it won't run with any library that I know. so what i am asking for
| > >>is a way to call other programs, or the header file nescarrary to use
| > >>the RUN command.
| > >
| > >
| > > Post this to 'comp.os.ms-windows.program mer.win32'. They will help you
| > > with available means of starting another process in Windows.
| > >
| > > V
| > >
| > >
| >
| > The system(const char *) function is available in cstdlib. Look at the
| > following code:
|
| Its not a function, its a macro and its not c++ either. So you are off
| topic.

[snip]

Where did you get that idea from?

Cheers,
Chris Val


Jul 23 '05 #9
codigo wrote:
The system(const char *) function is available in cstdlib. Look at the
following code:
Its not a function, its a macro


Says who?
and its not c++ either.
Depends on your definition of "c++". Here, people usually define it as "the
language defined by ISO/IEC 14882", and in that language, the headers
<stdlib.h> and <cstdlib> do declare such a function.
So you are off topic.
Nope.
Redirecting the OP to the appropriate newsgroup is beneficial for both the
users here and the OP. For example, in this specific case, cstdlib's
system macro isn't the recommended way to launch that application
It is the best way the standard offers.
and the executable in question is not found in the windows environment
path.


Well, other functions that might guarantee something like that are off-topic
here ;-)

Jul 23 '05 #10

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

Similar topics

1
2749
by: me | last post by:
I have been looking online for a year, and cant find one. I used to use the int86() command in dos command-line mode, but it can't work in linux. I am using Allegro to make my program work, but I need to put it on a floppy, both the kernal and the program. Allegro only works in X-windows, and is commericial anyway. I have tried to figure it...
1
2307
by: Sparhawk | last post by:
Hi, I want to integrate a code beautifier for C++ in the development process of my company. There are many beautifiers around which would meet our formatting requirements (SourceFormatX, SourceStyler, ...) but those are based on a GUI and thus require a developer to do this extra-step before checking the code in. We planned to include...
7
1538
by: Ben Bean | last post by:
Yes, the online documentation is EXcellent! So I will be using the php.exe in command line mode VERY SOON! I will readily pick up on ALL of the wonderful ways to parse an input file and send output to the DOS console or to a file. This is a special but *utterly* rudimentary desired configuring of PHP package. I downloaded the 7MB PHP...
7
3883
by: cbielins | last post by:
So yea... I rm-ed a rlv that our TS_FACT2 tblspace was using. So our db went to the crapper. The tblspace didn't have any pertinent info, so I'm ok with dropping the tblspace and starting over. These are the commands and errors that I have found: --db2 => restart database sware drop pending tablespace (TS_FACT2) DB20000I The RESTART...
1
3428
by: Chua Wen Ching | last post by:
Hi there, I have some problems when reading XML file. 1. First this, is what i did, cause i can't seem to read "sub elements or tags" values, so i place those values into attributes like this. Before: ----------
5
3221
by: HSP | last post by:
hi. i need to restore an old database. The db was backed up using a DLT drive, using 2 volumes. The content for the tapes was copied to file onto Solaris machine using rsh and dd (for backup purposes). Now, the drive is defective and can't read the tapes anymore. Server is AIX 4.3.2 and database is IBM DB2 Server (DB2 for AIX Version...
13
5767
by: PinkBishop | last post by:
I am using VS 2005 with a formview control trying to insert a record to my access db. The data is submitted to the main table no problem, but I need to carry the catID to the bridge table CatalogImage where imgID also needs to be placed. Below is my code behind to carry the catID using the Select @@Identity and insert imgID to the bridge...
4
4750
by: ohaqqi | last post by:
Hi everybody. I haven't programmed anything in about 8 years, I've read up a little bit on C and need to write a shell in C. I want to use strtok() to take an input from a user and parse it into the command and its arguments. for example: copy <file1> <file2> will copy file 2 to file 1, del <file1> will delete a file, etc. The exit command is...
2
8090
by: kya2 | last post by:
I am not able to create following store procedure. CREATE PROCEDURE DBSAMBA.InsertDeleteBatch(OUT norows INT ) RESULT SETS 1 LANGUAGE SQL BEGIN part1 DECLARE TOTAL_LEFT INT DEFAULT 0; SELECT COUNT(*)INTO TOTAL_LEFT FROM DBSAMBA.REPORTEDTRANSACTION_S; WHILE (TOTAL_LEFT > 0) DO
3
1817
by: Eric_Dexter | last post by:
I am trying to take some data in file that looks like this command colnum_1 columnum_2 and look for the command and then cange the value in the collum(word) number indicated. I am under the impression I need enumerate but I am not sure what to do with it any help would be nice. import sys
0
7546
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7471
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7985
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...
1
7503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7830
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...
1
5387
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...
0
5111
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...
0
3517
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...
1
1082
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.