returning a Collection with JNI

Discussion in 'Java' started by rmcalinden@gmail.com, Apr 14, 2005.

  1. Guest

    How do you return a Collection from a JNI method call in C++?

    normally, it's:

    jDataType = env->CallDataTypeMethod(jobject, jmethodID)

    but obviously there's none for CallCollectionMethod and there's no
    jCollection?

    Was thinking about returning and Object and casting it but not sure it
    can be cast to a c++ collection?

    thanks...
     
    , Apr 14, 2005
    #1
    1. Advertisements

  2. On 14 Apr 2005 15:33:18 -0700, wrote:
    > How do you return a Collection from a JNI method call in C++?


    The same way as for every other type of object.

    > normally, it's:
    >
    > jDataType = env->CallDataTypeMethod(jobject, jmethodID)
    >
    > but obviously there's none for CallCollectionMethod and there's no
    > jCollection?


    No, there's CallObjectMethod() and jobject.

    /gordon

    --
    [ do not email me copies of your followups ]
    g o r d o n + n e w s @ b a l d e r 1 3 . s e
     
    Gordon Beaton, Apr 15, 2005
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vikas
    Replies:
    2
    Views:
    17,206
    Vikas
    Aug 27, 2003
  2. Alex Hunsley

    IBM's JNI fails where Sun's JNI works

    Alex Hunsley, Nov 3, 2003, in forum: Java
    Replies:
    4
    Views:
    1,108
    Alex Hunsley
    Nov 4, 2003
  3. Pasturel Jean-Louis

    Porting JNI Windows under JNI LINUX + Wine ?

    Pasturel Jean-Louis, Feb 29, 2004, in forum: Java
    Replies:
    5
    Views:
    1,199
    Pasturel Jean-Louis
    Mar 3, 2004
  4. John McClain

    jni and garbage collection???

    John McClain, Nov 10, 2004, in forum: Java
    Replies:
    1
    Views:
    3,016
    Gordon Beaton
    Nov 11, 2004
  5. Gordon Beaton

    Returning String[] from C program (JNI)

    Gordon Beaton, Nov 15, 2004, in forum: Java
    Replies:
    2
    Views:
    11,127
    vipin_user
    Jun 20, 2007
  6. vasanth
    Replies:
    0
    Views:
    3,260
    vasanth
    Jan 25, 2005
  7. Øyvind Isaksen
    Replies:
    1
    Views:
    1,287
    Øyvind Isaksen
    May 18, 2007
  8. bgabrhelik
    Replies:
    0
    Views:
    1,169
    bgabrhelik
    Sep 29, 2009
Loading...