C++ executable calling java
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   shady_blues
Posted On:   Monday, July 16, 2001 07:38 PM

I need to create executable file (*.exe) in VC++ environment.
Then, I need to use and call java functions from this excutable file . Does neone know how this is possible. JNI is not an answer for this cuz it creates a dll file and not a executable file. Someone has suggested that its possible through corba. Does anyone know how to do it?
if possible can neone send me a sample code??

Re: C++ executable calling java

Posted By:   Dermot_Hennessy  
Posted On:   Wednesday, July 18, 2001 03:41 AM

To do this you need a C++ CORBA IDL compiler and a Java IDL compiler. You create an IDL file for the methods that you want to be accessible between the C++ process and the Java process and you compile it with the IDL-to-C++ compiler on the C++ side and the IDL-to-Java compiler on the Java side.



You then implement the methods/functions exposed by the IDL interface in C++ according to the instructions provided by your CORBA provider. You create implementations of your objects (called servants, which reside in your C++ executable process) and register them with a retrieval mechanism, e.g. the Naming Service.
You then call them through your Java client according to the instructions provided by your Java CORBA provider.



You should find sample code to do this in the programmers' references for the ORB implementations that you plan to use. You will find these on vendors websites - as a starter for ten check out Iona's and Visibroker's sites.

Hope this helps

Dermot

About | Sitemap | Contact