X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 24 Apr 2008 02:58 PM by  anon
Java to IDL mapping: constructor class :: class(signature) not found
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
24 Apr 2008 02:58 PM
    Hi, When i try calling objects from java into IDL, i get this error. If my java class has arguments, how should I pass it into IDL such that I dont get this error. Like if i have import java.util.date public class DateRange{ private final Date start private final Date end public DateRange( Date Start, Date end){ this.start = start; this.end = end; } ....and so on... if i call from IDL how should my syntax be: oJDate = OBJ_NEW('IDLjavaObject$DATERANGE, 'DateRange', (how should this portion be written so as to avoid an error ) Please do reply. I would greatly appreciate your help. Thank you Rohit

    Deleted User



    New Member


    Posts:
    New Member


    --
    24 Apr 2008 02:58 PM
    Hey james, Thanks a ton for the reply. Your guidance helped me a lot

    Deleted User



    New Member


    Posts:
    New Member


    --
    24 Apr 2008 02:58 PM
    The short answer to your question might be demonstrated with code like this: ; Make up some start date and end date. Note the below method for getting ; time in IDL to be set in milliseconds since the "Epoch" (1/1/1970 00:00:00 GMT) julBaseTime = long64(julday(1, 1, 1970, 0, 0, 0)) julStartTime = long64(julday(12,21,2006,0,0,0)) ; Julian date of 12/21/2006 in # Days julEndTime = long64(julday(3,21,2007,0,0,0)) ; 3/21/2007 nMsecsPerDay = 60LL * 60 * 24 * 1000 ; Java Date( ) wants milliseconds epochStartTime = (julStartTime - julBaseTime) * nMsecsPerDay epochEndTime = (julEndTime - julBaseTime) * nMsecsPerDay oJStartDate = obj_new('IDLJavaObject$JAVA_UTIL_DATE', $ 'java.util.Date', epochStartTime) oJEndDate = obj_new('IDLJavaObject$JAVA_UTIL_DATE', $ 'java.util.Date', epochEndTime) ; Anyone can test these next two commands to see that the Date object passes fine oJDTatProc = obj_new( $ 'IDLJavaObject$' + $ 'JAVAX_PRINT_ATTRIBUTE_STANDARD_DATETIMEATPROCESSING', $ 'javax.print.attribute.standard.DateTimeAtProcessing', oJStartDate) print, oJDTatProc->GetName() ; Now this next line is specific for Rohit's custom DateRange class oJDateRange = obj_new('IDLJavaObject$DATERANGE, 'DateRange', $ oJStartDate, oJEndDate)James Jones
    You are not authorized to post a reply.