Proxying the call to a JNI method

  • Thread starter Richard B. Christ
  • Start date
R

Richard B. Christ

Hi all,

We got a dll and I am trying to use it. If I got right, calling a
native method of this dll from the wrong package will throw an
UnsatisfiedLinkError error, right? The problem is that the
programmer's package structure is not the same as our. To solve this
problem I am thinking of making a wrapper to the dll native calls so
that the right methods get called. Is that a good idea to solve this
problem or did I miss something here?
For instance, if I would like to call the native method
Java_MyFullyQualifiedClass_MyMethod from the following class
package.subpackage.subsubpackage.MyClass after having successfully
loaded the corresponding library, should that work? Or do I have to
make a kind of package structure that is similar to
MyFullyQualifiedClass. Any help would be gratefully appreciated.
Regards,

richard
 
J

Jim Sculley

Richard said:
Hi all,

We got a dll and I am trying to use it. If I got right, calling a
native method of this dll from the wrong package will throw an
UnsatisfiedLinkError error, right? The problem is that the
programmer's package structure is not the same as our. To solve this
problem I am thinking of making a wrapper to the dll native calls so
that the right methods get called. Is that a good idea to solve this
problem or did I miss something here?
For instance, if I would like to call the native method
Java_MyFullyQualifiedClass_MyMethod from the following class
package.subpackage.subsubpackage.MyClass after having successfully
loaded the corresponding library, should that work? Or do I have to
make a kind of package structure that is similar to
MyFullyQualifiedClass. Any help would be gratefully appreciated.

Typically, a DLL is shipped with the Java classes that use it. Do you
not have the Java code to go with this DLL?

Jim S.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,691
Members
48,796
Latest member
Greg L.

Latest Threads

Top