By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,301 Members | 1,373 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,301 IT Pros & Developers. It's quick & easy.

Pass data between C++ programs

P: n/a
Hi Group,
I hope I got into the right place. If I have two different C++
programs (exe). Is there anyway I can pass data (numbers, strings,
etc) between the 2 programs (without combining into 1 exe)? They are
supposed to work "live", e.g. one prog picking up data from a device
and then pass it to the other prog that will analysis or use the data
for animation. And, how to do that? They are developed by two
different people, so I do not wish to combine the two programs into
one, but would be good to use one of their methods to do the work.
Any help will be appreciated.
Regards
Hong
Jul 22 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hong wrote:
I hope I got into the right place. If I have two different C++
programs (exe). Is there anyway I can pass data (numbers, strings,
etc) between the 2 programs (without combining into 1 exe)?
Write them to a file and read the file in the other program. There
is no other way in the standard C++. All other ways are platform-
specific (shared memory, sockets, etc.)

C++ does not define interaction between processes. The language is
defined as if every program executes by itself under some kind of
"virtual machine". Inter-process communication is part of the OS (if
the OS supports the notion of a "process").
[...]


Post to a newsgroup dedicated to your OS.

Victor
Jul 22 '05 #2

P: n/a
ow*@ieee.org (Hong) wrote in message news:<77*************************@posting.google.c om>...
Hi Group,
I hope I got into the right place. If I have two different C++
programs (exe). Is there anyway I can pass data (numbers, strings,
etc) between the 2 programs (without combining into 1 exe)? They are
supposed to work "live", e.g. one prog picking up data from a device
and then pass it to the other prog that will analysis or use the data
for animation. And, how to do that? They are developed by two
different people, so I do not wish to combine the two programs into
one, but would be good to use one of their methods to do the work.
Any help will be appreciated.
Regards
Hong


I take it you can modify both programs. If that is correct, you might
be interested in the online C++ middleware generator available at
http://www.webebenezer.net. If you send the following input:

Messages
(list<int>)
(string, string)
}

as a "Middle" file, you will get a C++ class back. The class will
have
functions that send and receive instances of the types given in the
input.
You have to be careful about byte ordering when using the generated
code. (We have added support for char* and single inheritance, but
it isn't available yet on the web site. If things go as expected,
we'll update the site by the end of the month.)

Brian Wood
Jul 22 '05 #3

P: n/a
ow*@ieee.org (Hong) wrote in message news:<77*************************@posting.google.c om>...
Hi Group,
I hope I got into the right place. If I have two different C++
programs (exe). Is there anyway I can pass data (numbers, strings,
etc) between the 2 programs (without combining into 1 exe)? They are
supposed to work "live", e.g. one prog picking up data from a device
and then pass it to the other prog that will analysis or use the data
for animation. And, how to do that? They are developed by two
different people, so I do not wish to combine the two programs into
one, but would be good to use one of their methods to do the work.
Any help will be appreciated.
Regards
Hong


Using a socket is one way to do this...

Guido
Jul 22 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.