473,657 Members | 2,492 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Interaction between two programs

I'm sure this might be a simple questions, but here it goes anyway. I
am trying to do a 'front end' to a program. For example I have a
program that doesn't take command line arguments, but prompts the user
for input every time it is run, ie. Enter your name:

I want to run a program that will automatically type the name into
that field. I just don't really know where to start. Is this
suppossed to be a spawn or an exec? I saw something about pipes, but
didn't quite get it. Please explain for me.

This is NOT for a class, just trying to learn how to do things
Jul 22 '05 #1
3 1897
so****@satx.rr. com (Sean) wrote in news:74cb4ff3.0 405201251.27d1c 150
@posting.google .com:
I'm sure this might be a simple questions, but here it goes anyway. I
am trying to do a 'front end' to a program. For example I have a
program that doesn't take command line arguments, but prompts the user
for input every time it is run, ie. Enter your name:

I want to run a program that will automatically type the name into
that field. I just don't really know where to start. Is this
suppossed to be a spawn or an exec? I saw something about pipes, but
didn't quite get it. Please explain for me.

This is NOT for a class, just trying to learn how to do things


Your question has nothing to do with C++. It is off topic in this
newsgroup.

It is also very platform specific, though you don't even specify what
platform implementation you're interested in.

For unix, see news:comp.unix. programmer
Ask about pipe/popen, fork and exec.

For windows, see news:comp.os.ms-windows.program mer.*
Ask about CreatePipe, CreateProcess etc...

Cheers.
Jul 22 '05 #2
Sean posted:
I'm sure this might be a simple questions, but here it goes anyway. I
am trying to do a 'front end' to a program. For example I have a
program that doesn't take command line arguments, but prompts the user
for input every time it is run, ie. Enter your name:

I want to run a program that will automatically type the name into
that field. I just don't really know where to start. Is this
suppossed to be a spawn or an exec? I saw something about pipes, but
didn't quite get it. Please explain for me.

This is NOT for a class, just trying to learn how to do things

This is a C++ newsgroup, no more no less. We conversate about C++ here. We
don't mention a word about platforms. You may find this a bit hard to
imagine, but think about things like: Encrypting Data, Encoding an MP3. Both
these processes are platform independant.
C++ is used to write programs for anything. A C++ compiler generates machine
code, which can be a Windows program, or the interface for your brand new
microwave, or the menus on your mobile phone.
Therefore, we don't talk about two programs running at once here in this
newsgroup. You're going to have to go to a very platform specific newsgroup
to talk about this. I myself am familiar with Win32 programming, so... if
the programs you're writing are Win32, then here's one way of going about
it:

First make your first program, into which you enter your name. You're done
with the first program now.

The trick is in writing the second program. I suggest that you use the
function "FindWindow " or a similar Win32API function that can be used to
obtain some sort of handle to the other program. Once you've got some sort
of handle, you use more Win32API functions to send information and/or
manipulate the first program. You'll most likely use the Win32 function
"SendMessag e" for this.

Further questions on this subject to:

News Server: msnews.microsof t.com
Newsgroup: microsoft.publi c.win32.program mer.kernel

Note that the above newsgroup isn't language specific, so don't post any
code. People will simply tell you which Win32 function to use and in what
way. Make sure you tell them it's a console application.
Hope that helps.
-JKop
Jul 22 '05 #3
Sean wrote:

I'm sure this might be a simple questions, but here it goes anyway. I
am trying to do a 'front end' to a program. For example I have a
program that doesn't take command line arguments, but prompts the user
for input every time it is run, ie. Enter your name:

I want to run a program that will automatically type the name into
that field. I just don't really know where to start. Is this
suppossed to be a spawn or an exec? I saw something about pipes, but
didn't quite get it. Please explain for me.

This is NOT for a class, just trying to learn how to do things

You could possibly make the use of the following:

Both C++ and C define three "standard streams": stdin, stdout and stderr.
The type of these expressions is FILE*, and they are required (I think;
need to double-check) to be open at the program start-up. See <stdio.h>
or <cstdio>.
The C++ objects cin, cout and cerr use the respective standard streams as well.

Now, what is hiding behind each of the standard stream depends on the way
the program was started (they could be attached to the terminal, to files,
to streams of another program, etc.). This part, however, is indeed system
dependent. One thing that is standard is the system() function, but its
behaviour is again system dependent.

Denis
Jul 22 '05 #4

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

Similar topics

4
1267
by: Vikram | last post by:
Hi, I would like to make a dos program which can directly interact with the buffer. I mean that there will be a loop which will constantly check the the buffer for any pressed key and if there was a key pressed then store it's value. I tried to use streambuf class but was unable to do so. Basically I have made a graphical clock(In Dos) and Dos does not have multithreading capability. So I want to
0
1538
by: David Virgil Hobbs | last post by:
What programming codes will enable me to achieve interaction between vb or c# and HTML form values, without a page reload occurring every time a script is run? At least with javascript and vb script you can run scripts that change form values WITHOUT page reloads. What a weird language vb/c#/asp.net is turning out to be. . Every time you click a button, the whole page refreshes and you lose your scrolling position. What are the languages...
3
4120
by: Aaron Queenan | last post by:
I have a form which performs some asynchronous code. I want to display a wait cursor when it starts, and hide the wait cursor when it has completed. This part works fairly well, using: this.TopLevelControl.Cursor = System.Windows.Forms.Cursors.WaitCursor; I also want to prevent user interaction with the controls on my form while the wait cursor is displayed, so that use events (except resize and cancel) are blocked. What is the...
2
15903
by: Chakkaradeep | last post by:
hi all, as it was discussed earlier in this forum titled,"Execution of Another Application in Services", i got the answer that Services are not meant for executing another applications, but Microsoft has given the options to Interact with Desktop for the Services which need to... I got many C Service Programs wherein they execute another application depending upon the need...when i asked how can it be done in C#, many said it should...
2
6888
by: deko | last post by:
When to use a privileged user thread rather than a windows service? That's the question raised in a previous post . It was suggested that if the service needs to interact with a WinForms app (which is the UI used to adjust the actions taken by, and the schedule of the service), then a privileged user thread should be used in the UI - no service required. But... "A windows service enables the creation of long-running executable
4
21842
by: vivek | last post by:
I am new to flash and want someone to guide me, Is it possible to create a UI entirely in Flash and that will inetract with C# components (backend) and these components will in return interact with database etc. If flash and C# interaction is possbile then, what are the prons and cons of this interaction? As using flash, one can create wonderful UI. But in return I also want it to interact fully with C# components.
2
1731
by: Alberto | last post by:
How do you write the interaction diagram's messages in c#? like calling a method in the object class? like an event? Thank you
0
2136
by: Omar Abid | last post by:
Reason of this project: The Microsoft.VisualBasic.Interaction class exposes many useful commands and methods that were available in Visual Basic like AppActivate, Beep, Callbyname... This tutorial shows how to work with some of them. Project details: 1- From VB 6.0 to VB .net 2.0 2- Useful interaction commands 3- Samples of interaction commands
3
3944
by: mmm | last post by:
I am looking for advice on Python Editors and IDEs I have read other posts and threads on the subject and my two questions at this time are mainly about the IDLE-like F5-run facilities. While I am fairly happy using IDLE, the debugger is unintuitive to me and I wanted a project manager and a better variable/ class browser and also the potential to edit/run other languages such as R and Tex/Latex. Windows and LINUX compatibility is...
0
8403
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
8833
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...
1
8509
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
8610
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
7345
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...
0
4168
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...
1
2735
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
1967
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1730
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.