dcsimg
Simple Solution for calling any pre-built DLL (c , c++ , Delphi)
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Chintan_Wala
Posted On:   Friday, June 8, 2001 03:33 PM

I am new to JNI and Java as such, Can someone help me do the following .. 1. I want to call the function "Beep" in the Winnt dll "kernal32.dll" 2. I have created a dll in Delphi which has a method returning PChar .. my java code is public class jniResearch { public native String whoAmI(); static { String library = "hello"; try { System.loadLibrary( library ); } catch( Exception e ) { System.out.println( " ERROR: Unable to load " + library " Exception: " + e + " " ); } } public static void main( String args[] ) {    More>>

I am new to JNI and Java as such, Can someone help me do the following ..
1. I want to call the function "Beep" in the Winnt dll "kernal32.dll"

2. I have created a dll in Delphi which has a method returning PChar ..
my java code is
public class jniResearch
{
public native String whoAmI();
static
{
String library = "hello";
try
{
System.loadLibrary( library );
}
catch( Exception e )
{
System.out.println( "
ERROR: Unable to load " + library "
Exception: " + e + "
" );
}
}

public static void main( String args[] )
{
jniResearch thisRD = new jniResearch();
String aStr = thisRD.whoAmI();
System.out.println (aStr);
}

----
I receive the error ...
java.lang.UnsatisfiedLinkError: whoAmI
at jniResearch.whoAmI(Native Method)
at jniResearch.main(jniResearch.java:37)

----------
Please Helllppppp !!
Thanks in Advance

   <<Less
About | Sitemap | Contact