Computing.Net > Forums > Programming > Linking two C++ programs

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Linking two C++ programs

Reply to Message Icon

Name: Nil_IQ
Date: October 26, 2006 at 03:23:19 Pacific
OS: Win XP
CPU/Ram: 3ghz/1gb
Comment:

Hi.

I am something of a C++ novice, I understand the basic principles such as classes, inheritance e.t.c, but that's about it.

What I need to do is have a program pass a variable (a bit stream) to another program in real-time. I have searched the web, but can't seem to find any easily-accessible tutorials on the subject. If anyone could either link me to such a tutorial if one exists, or just point me in the right direction, I would appreciate it.

Thanks,

Nil



Sponsored Link
Ads by Google

Response Number 1
Name: Fozzie
Date: October 27, 2006 at 18:47:58 Pacific
Reply:

If want to share data with a program that you have made, them using multiple threads may be what you need.

http://www.linuxdocs.org/HOWTOs/C++...

If you are working with the Win32 API then look up processes in the Win32 help reference. Win32 has some functions for piping data between processes I believe.


If you want to share data with an existing program that you don't have souce code for then it probably aint gonna happen.

If you could post more deteailed information someone here might be able to steer you in the right direction.


0

Response Number 2
Name: HaTcH
Date: October 31, 2006 at 15:30:14 Pacific
Reply:

It might be kindof slow, but you could possibly use a TCP socket to send/receive data between the programs.

Alternately you could have program 1 dump a file that contains the data the other needs and have prog 2 open/read from it.

When using Linux (and possibly windows) you can use pipes between the programs, where one program writes to stdout and the other reads from. The typical structure for something like this would be
% prog2 | prog1 arguments

A real life example is searching dmesg output for something important..
% dmesg | grep ACPI


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Linking two C++ programs

C++ Programming Website www.computing.net/answers/programming/c-programming-website/4752.html

C programming help www.computing.net/answers/programming/c-programming-help-/6364.html

C++ Game programing guides plz help www.computing.net/answers/programming/c-game-programing-guides-plz-help/2274.html