472,353 Members | 1,433 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

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 3651
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.programmer.win32'. They will help you
with available means of starting another process in Windows.

V
Jul 23 '05 #2
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.programmer.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******@comcast.net> wrote in message
news:fN********************@comcast.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.programmer.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******@comcast.net> wrote in message
news:fN********************@comcast.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.programmer.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*******************@news20.bellglobal.com.. .
|
| "Ken Human" <ke******@comcast.net> wrote in message
| news:fN********************@comcast.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.programmer.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

"Rolf Magnus" <ra******@t-online.de> wrote in message
news:d4*************@news.t-online.com...
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 ;-)


lol. point taken. Thanks for the input, guys.
Jul 23 '05 #11

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

Similar topics

1
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....
1
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...
7
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...
7
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...
1
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,...
5
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...
13
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...
4
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()...
2
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 ...
3
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...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.