Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JNI , shared stubs, CFunction (not CFunc) ?

Reply
Thread Tools

JNI , shared stubs, CFunction (not CFunc) ?

 
 
rover
Guest
Posts: n/a
 
      11-10-2004
Hi,

I've been reading about JNI and shared stubs at

http://java.sun.com/docs/books/jni/html/jniTOC.html

However, when i try to use the class "CFunction" (see 9.4.3 @ url) , my
compiler (IntelliJ) says it cannot find the class.
I did find a jnistb10.zip , containing CFunc, CMalloc, CPtr, and the C
code for "disp.dll". However, this zip contains "CFunc" instead of
"CFunction" ! This is fine for wrapping a simple C calling convention
function like "atol" (this example works with CFunc) , but i want to
wrap some "stdcall" win api functions. With CFunc i get an access
violation, probally due to the fact its not a C but a stdcall function.
So i've been searching for the new and improved classes, namely
CFunction , but unfortunally i cannot find it anywhere. Strange how it
seems to be part of the JVM since 1.2 , but just doesnt seem to be there.

Anyone who can help me ?

Thanks,

Rover
 
Reply With Quote
 
 
 
 
Chris Uppal
Guest
Posts: n/a
 
      11-10-2004
rover wrote:

> I've been reading about JNI and shared stubs at
>
> http://java.sun.com/docs/books/jni/html/jniTOC.html
>
> However, when i try to use the class "CFunction" (see 9.4.3 @ url) , my
> compiler (IntelliJ) says it cannot find the class.


That class, and the others, are not part of JNI, but are part of a software
package developed by the author and described in his book. (And pretty cool
too, I may add.) If you go up a couple of levels to:

http://java.sun.com/docs/books/jni/

then you'll find a link to download the code for the examples from the book.
That includes the source to the CFunction, etc, as well as the corresponding
JNI source. I haven't tried it, but it looks as if it will handle stdcall
functions, see the file:

jniexamples/chap9/SharedStubs/dispatch_x86.c

for example.

-- chris


 
Reply With Quote
 
 
 
 
rover
Guest
Posts: n/a
 
      11-10-2004
rover wrote:
> Hi,
>
> I've been reading about JNI and shared stubs at
>
> http://java.sun.com/docs/books/jni/html/jniTOC.html
>
> However, when i try to use the class "CFunction" (see 9.4.3 @ url) , my
> compiler (IntelliJ) says it cannot find the class.
> I did find a jnistb10.zip , containing CFunc, CMalloc, CPtr, and the C
> code for "disp.dll". However, this zip contains "CFunc" instead of
> "CFunction" ! This is fine for wrapping a simple C calling convention
> function like "atol" (this example works with CFunc) , but i want to
> wrap some "stdcall" win api functions. With CFunc i get an access
> violation, probally due to the fact its not a C but a stdcall function.
> So i've been searching for the new and improved classes, namely
> CFunction , but unfortunally i cannot find it anywhere. Strange how it
> seems to be part of the JVM since 1.2 , but just doesnt seem to be there.
>
> Anyone who can help me ?
>
> Thanks,
>
> Rover



Found it

At http://java.sun.com/docs/books/jni/ :


"Download the example code in this book in ZIP or tar.gz formats"

The zip contains what i was searching for



 
Reply With Quote
 
Curt Cox
Guest
Posts: n/a
 
      12-17-2004
I'm having trouble building disp.dll. Does anybody have pre-built
binaries, or know where I can get them?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JNI thread vs. native thread vs. JNI call bgabrhelik Java 0 09-29-2009 03:33 PM
Re: JNI: Error loading DLL from JNI DDL vasanth Java 0 01-25-2005 11:03 AM
Re: JNI: Error loading DLL from JNI DDL vasanth Java 0 01-25-2005 11:01 AM
Porting JNI Windows under JNI LINUX + Wine ? Pasturel Jean-Louis Java 5 03-03-2004 07:50 PM
IBM's JNI fails where Sun's JNI works Alex Hunsley Java 4 11-04-2003 10:34 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57