473,665 Members | 2,798 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Invoking other executable prgms using C?

hi

Is it possible to open an executable program like NOTEPAD(win)
using C-Program...(othe r than the function system() )? if so,please
provide me with an eg code...if not why?

Thanks in advance.

Dec 27 '05 #1
32 2094
Pravin wrote:
hi

Is it possible to open an executable program like NOTEPAD(win)
using C-Program...(othe r than the function system() )? if so,please
provide me with an eg code...if not why?

Thanks in advance.

When you said "open" I presume you meant "execute". If you want to
really just open a file, the fopen is there to help you.

If you want to execute any program, then the only standard C call is
system().

<OT Call="POSIX">
My system has another set of calls exec* (execl,execv, etc.)
(#include <unistd.h>), which comes close (but for sure it's not same.)
You could refer the manuals of your compiler to see if it has something
similar and it has things that meets your needs.

However, note that this is Off-Topic to discuss further about
non-standard C calls further here. If you further have doubts regarding
the call, then please take to relevant (OS and/or Compiler specific) group.
</OT>

--
(Welcome) http://www.ungerhu.com/jxh/clc.welcome.txt
(clc FAQ) http://c-faq.com/
Dec 27 '05 #2
"Pravin" <pr***********@ gmail.com> writes:
Is it possible to open an executable program like NOTEPAD(win)
using C-Program...(othe r than the function system() )? if so,please
provide me with an eg code...if not why?


There is no way in standard C to execute another program other than
the system() function. There may be other methods available on your
system; if you want more information, you'll need to ask in a
newsgroup that's specific to your system (not comp.lang.c).

--
Keith Thompson (The_Other_Keit h) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Dec 27 '05 #3
On Tue, 27 Dec 2005 06:51:24 UTC, "Pravin" <pr***********@ gmail.com>
wrote:
Is it possible to open an executable program like NOTEPAD(win)
using C-Program...(othe r than the function system() )? if so,please
provide me with an eg code...if not why?


If you want a Windows-specific answer (as your question sort of implies)
then you might do better to crosspost to a Windows programming newsgroup
- posting to an OS/2 programming group won't help much!

OTOH, if it *is* OS/2 help you require, please ask again.

Dec 27 '05 #4
On 2005-12-27, Anand <An***@no-replies.com> wrote:
Pravin wrote:
hi

Is it possible to open an executable program like NOTEPAD(win)
using C-Program...(othe r than the function system() )? if so,please
provide me with an eg code...if not why?

Thanks in advance.
When you said "open" I presume you meant "execute". If you want to
really just open a file, the fopen is there to help you.

If you want to execute any program, then the only standard C call is
system().

<OT Call="POSIX">
My system has another set of calls exec* (execl,execv, etc.)
(#include <unistd.h>), which comes close (but for sure it's not same.)
You could refer the manuals of your compiler to see if it has something
similar and it has things that meets your needs.

However, note that this is Off-Topic to discuss further about
non-standard C calls further here. If you further have doubts regarding
the call, then please take to relevant (OS and/or Compiler specific) group.

<OT more>
However, he's unlikely to be able to run "NOTEPAD (win)" with exec* -
for that he probably needs CreateProcess or CreateProcessEx - that
should give him enough to google for if he can't find an appropriate
windows-specific newsgroup.
</OT> </OT>

Dec 27 '05 #5
Bob Eager wrote:
On Tue, 27 Dec 2005 06:51:24 UTC, "Pravin" <pr***********@ gmail.com>
wrote:

Is it possible to open an executable program like NOTEPAD(win)
using C-Program...(othe r than the function system() )? if so,please
provide me with an eg code...if not why?

If you want a Windows-specific answer (as your question sort of implies)
then you might do better to crosspost to a Windows programming newsgroup
- posting to an OS/2 programming group won't help much!

OTOH, if it *is* OS/2 help you require, please ask again.


There are lots of ways in OS/2...


Dec 27 '05 #6
In comp.lang.c Pravin <pr***********@ gmail.com> wrote:

(F'ups not set.)
Is it possible to open an executable program like NOTEPAD(win)
using C-Program...(othe r than the function system() )? if so,please
provide me with an eg code...if not why?


As noted, there is a very narrow C answer to this question. I suspect
you could benefit from a visit to the following URLs.

http://www.ungerhu.com/jxh/clc.welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html

--
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.
Dec 27 '05 #7
Christopher Benson-Manica wrote:
In comp.lang.c Pravin <pr***********@ gmail.com> wrote:

(F'ups not set.)
Is it possible to open an executable program like NOTEPAD(win)
using C-Program...(othe r than the function system() )? if
so,please provide me with an eg code...if not why?


As noted, there is a very narrow C answer to this question. I
suspect you could benefit from a visit to the following URLs.

http://www.ungerhu.com/jxh/clc.welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html


Why are you indulging in this campaign to revise all subject lines
to "[MTA]"?

--
Some informative links:
news:news.annou nce.newusers
http://www.geocities.com/nnqweb/
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.caliburn.nl/topposting.html
http://www.netmeister.org/news/learn2quote.html

Dec 27 '05 #8
In comp.lang.c Chuck F. <cb********@yah oo.com> wrote:

(Groups trimmed to comp.lang.c)
Why are you indulging in this campaign to revise all subject lines
to "[MTA]"?


It was suggested as more fitting than "OT" for Meta Topical Advice,
and it sounded reasonable to me. If it's doing more harm than good,
I'll be happy to continue using "OT".

--
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.
Dec 27 '05 #9
Christopher Benson-Manica wrote:
In comp.lang.c Chuck F. <cb********@yah oo.com> wrote:

(Groups trimmed to comp.lang.c)
Why are you indulging in this campaign to revise all subject
lines to "[MTA]"?


It was suggested as more fitting than "OT" for Meta Topical
Advice, and it sounded reasonable to me. If it's doing more
harm than good, I'll be happy to continue using "OT".


You may have noticed that the better newsreaders also automatically
remove the "(was ...)", thus convincing the stupider newsreaders
that the thread is new. Thus my choice of 'revise' above.

--
Some informative links:
news:news.annou nce.newusers
http://www.geocities.com/nnqweb/
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.caliburn.nl/topposting.html
http://www.netmeister.org/news/learn2quote.html

Dec 28 '05 #10

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

Similar topics

0
2103
by: Prasad | last post by:
We are invoking a SQL DTS component (lets call it Comp1) built by us in another component (Comp2).Comp1 was built by creating the DTS package using the SQL DTS wizard and then saving it as a VB .bas file - this was converted to .NET class module. To this module we added some cutom transformation tasks. An additional info - we are invoking Comp1 in a loop inside Comp2. The transformation succesfully happens for a few files in the list...
6
6172
by: Patrick | last post by:
Following earlier discussions about invoking a .NET class library via ..NET-COM Interop (using regasm /tlb) at http://groups.google.com/groups?hl=en&lr=&threadm=%23Van7eSrEHA.4004%40TK2MSFTNGP10.phx.gbl&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26selm%3D%2523Van7eSrEHA.4004%2540TK2MSFTNGP10.phx.gbl I have concluded that my .NET class library (following the suggestions. namely setting the marshall type, etc.) , I can 1) Invoke public methods...
5
2599
by: Simon Harvey | last post by:
Hi, I have a simple .exe application that I need to invoke from my C# application. I need to send it two strings and then get the result back. Can anyone advise me on how this is done? Also, I'm currently using a windows forms application but I would like to use an ASP.net appliocation to invoke the .exe file in the future. Is this possible and will it cause any complications?
3
1005
by: Al_C | last post by:
Hi, We have a few apps that we would like to invoke from withing our program. Suggestions? Should I create a seperate thrread to run the app in. The idea is to call excel for example from within our vb.exe Thanks in advance, Al
2
4367
by: Tim Reed | last post by:
Hello ... my Dad is dabbling in VB & has a question about invoking a PDF (to display a help file or manual). Myself, I don't know VB - but I *do* know how to post to a NG <g>. If anyone has a solution, I would pass it on with appreciation. Thanks! - Tim ===================================== I'd like to include in a Visual Basic (VB6) program a command that would bring up the User's Manual. I'm pretty much settled on the idea...
1
1744
by: sukatoa | last post by:
A86 code (Assembly) jmp main main: mov ah,0h ;Service 0, Captures the input and stores it to register al... int 16h ; Interrupt 16 BIOS... mov ah,2h ;Service 2 mov dl,al ;Copy register al to register dl
2
5556
by: =?Utf-8?B?SmltIE93ZW4=?= | last post by:
Hi John, Hopefully this post will find its way back to you - or perhaps be answered by someone else. As I mentioned in my last post on the earlier portion of this thread, changing the serialization settings for the build handled the initial slows we encountered when invoking the web service. Since that time, we ported the original VB.net code over to C# - this was done to make it cleaner easier to include the project in the rest of...
2
1624
by: orsula | last post by:
Hi all, First I would like to say that I'm thrilled to be a part of this great news group! I'm kinda new to c#, yet I have a tight schedule to deliver my project (ain't it always like that :) and I have a question regarding a process invoking another executable. If you could just point out some keywords which I can google up it can
0
8438
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8863
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
8779
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...
1
8549
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8636
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...
0
7376
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6187
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...
1
2765
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
2004
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.