473,508 Members | 2,281 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 1892
so****@satx.rr.com (Sean) wrote in news:74cb4ff3.0405201251.27d1c150
@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.programmer.*
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
"SendMessage" for this.

Further questions on this subject to:

News Server: msnews.microsoft.com
Newsgroup: microsoft.public.win32.programmer.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
1262
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...
0
1533
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...
3
4110
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: ...
2
15894
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...
2
6878
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...
4
21831
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...
2
1720
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
2124
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...
3
3931
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...
0
7225
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,...
0
7324
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,...
1
7042
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...
0
5627
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,...
1
5052
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...
0
3193
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...
0
3181
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1556
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 ...
0
418
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...

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.