X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 23 Apr 2008 11:54 AM by  anon
Interfacing Java and IDL
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
23 Apr 2008 11:54 AM
    Hi friends, I was trying to call objects from Java into IDL. I succeeded in some aspects. But, when the classes have arguments with them, how should I call these objects. For eg; if my class is public class Bicycle{ public Bicycle( int gear, int speed) .... how should my object in IDL be... I tried many different things...but they do not work... Please reply. I would greatly appreciate your help Thank you Rohit

    Deleted User



    New Member


    Posts:
    New Member


    --
    23 Apr 2008 11:54 AM
    This is a two-part answer. The second part is in the top-level message thread No. 5083 and discusses how to pass an IDL-Java object as an argument to another IDL-Java object. Anyhow, to answer this immediate question, the IDL documentation shows the following syntax: oJava = OBJ_NEW(IDLjavaObject$JAVACLASSNAME, JavaClassName $ [, Arg1, Arg2, ..., ArgN])That is, Java args can be fed to the constructor for an 'IDLJavaObject' in a simple comma-delimited list that follows the 'JavaClassName' argument. In your example, then: oJBicycle = OBJ_NEW('IDLjavaObject$BICYCLE', 'Bicycle', 3, 18) ; or ... mygear = 3 myspeed = 18 oJBicycle = OBJ_NEW('IDLjavaObject$BICYCLE', 'Bicycle', mygear, myspeed) James Jones
    You are not authorized to post a reply.