On 31 Jul 2003 15:22:08 -0700,
(Paul Lee) wrote:
> Hi all,
> Thanks for your replies - what I meant when I said "call an
> application" was call methods within that application, such as alter
> the appearance of the GUI or retrieve data from the app.
If this application is already up and running, then it has
to provide the communication mechanism.
> The thing that is confounding me is the Sun Java JNI example talks
> about interfacing with an C++ app when the source code to that app is
> available - in this case, it won't be, although we do have the app's
> APIs to hand.
What sort of API's? JNI is simple, it allows your executing
Java code to call into code you have written in C or C++ which
is in the form of a dll or shared library. What you do once
you are in C/C++ is entirely up to you. If you want to call
some other API to talk to some external app, have a good time.
So if you're goal is to talk from your Java code to some other
app, you have to first find out what the other app is using
to talk with. Then you need to look at your Java code and
see if Java provides the means to understand that form of
communication. If it does, then you have to look at your
environment and see if that imposes any further restrictions.
For example, if the app provides callable API's and these
API's do their work using shared memory, calling these on
a physically different machine would not work.
It's impossible for us to give you a definitive answer based
on the little (and unclear) information you have provided.
--Joe