T
Tim Ward
I've got this MFC application which needs some functionality (basically a
protocol stack and some application layer stuff) that I've only got in Java.
From the MFC application I need to
(a) start up the Java application, with no GUI
(b) tell it what to do
(c) check its progress (the operation will take several minutes)
(d) cancel it if the user gets bored
(e) retrieve results from the Java application and display them in the MFC
GUI.
Now, this is to be a quick and dirty hack to fill a temporary need - if I
were doing this "properly" I'd probably re-implement the protocol stack in
C++, but I want something quicker than that.
I don't need the Java application to throw events back at the C++ one,
polling for progress and results would be good enough (because it's a
temporary fudge).
Clearly I can communicate between the C++ and Java applications by several
means:
(1) the C++ application can put stuff into Java's stdin and read results
from Java's stdout
(2) I can set up a socket connection between the two applications and design
and write a quick dirty private protocol
(3) if I were feeling really uninventive they could communicate with disk
files (yuk, even for a quick hack).
Are there other suggests for communication that meet the requirement of
being quick and easy to implement? For example, is there some COM gateway I
could wrap round the Java application to make it look like a COM server?
(Corba is over the top, I'm not going there.)
protocol stack and some application layer stuff) that I've only got in Java.
From the MFC application I need to
(a) start up the Java application, with no GUI
(b) tell it what to do
(c) check its progress (the operation will take several minutes)
(d) cancel it if the user gets bored
(e) retrieve results from the Java application and display them in the MFC
GUI.
Now, this is to be a quick and dirty hack to fill a temporary need - if I
were doing this "properly" I'd probably re-implement the protocol stack in
C++, but I want something quicker than that.
I don't need the Java application to throw events back at the C++ one,
polling for progress and results would be good enough (because it's a
temporary fudge).
Clearly I can communicate between the C++ and Java applications by several
means:
(1) the C++ application can put stuff into Java's stdin and read results
from Java's stdout
(2) I can set up a socket connection between the two applications and design
and write a quick dirty private protocol
(3) if I were feeling really uninventive they could communicate with disk
files (yuk, even for a quick hack).
Are there other suggests for communication that meet the requirement of
being quick and easy to implement? For example, is there some COM gateway I
could wrap round the Java application to make it look like a COM server?
(Corba is over the top, I'm not going there.)