using natives


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: using natives

  1. #1
    Join Date
    Nov 2002
    Posts
    138

    using natives

    using natives...

    what's the C++/Windows.h defined equivalent for a java boolean?

    i have a java method that returns a boolean, and i'm calling it from the native side.

    is it ok to assume, that if i were to pass a value from a java method returning, let's say, an int to a windows.h defined data type like BOOL, is it ok? or do i have to cast it explicitly or something?

  2. #2
    Join Date
    Nov 2002
    Posts
    138
    also does anyone know of a good JNI complete reference book? it's very hard to find one here in our local bookstores. having to order it online is something else, since i can't check the contents. any suggestions?

  3. #3
    Join Date
    Mar 2003
    Posts
    834
    I've never done it, but your idea of an int does sound sensible. Can't you just try it out and see if it works?
    ArchAngel.
    O:-)

  4. #4
    Join Date
    Mar 2003
    Posts
    86

    jni.h

    Just take a look at jni.h that is places under your jdk home dir. You will find all the java types defenitions there.

    Sharbov.

  5. #5
    Join Date
    Nov 2002
    Posts
    138
    nah, it's BOOL as typdefed in windows.h. it's a 16-bit integer that returns a 1 or 0 for true and false. and i don't have to cast it or anything. was just wondering since what to place in e.g.( " is true or false %? ", MYBOOLVAR ). boolean is written jboolean when calling from the native side.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center