dcsimg
Calling VB dll function from Java
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   janardhanarao_juluru
Posted On:   Friday, June 23, 2006 07:05 AM

Hi All, Step : 1 Test1.java =========== class Test1 { static { System.loadLibrary("ChkStr"); } public static void main(String ar[]) { System.out.println("Hello world from Java"); Test1 t=new Test1(); String l =t.check_string("abc"); } public native String check_string(String hWnd); } Step : 2 ChkStr.dll Public Function check_string(strParam As String) check_string = "hello from vb" End Function    More>>

Hi All,

Step : 1


Test1.java

===========

class Test1

{


static

{

System.loadLibrary("ChkStr");


}



public static void main(String ar[])

{

System.out.println("Hello world from Java");

Test1 t=new Test1();



String l =t.check_string("abc");



}

public native String check_string(String hWnd);


}


Step : 2 ChkStr.dll

Public Function check_string(strParam As String)

check_string = "hello from vb"

End Function


when i run my program , it will shows following error...




C:
pic>javac Test1.java


C:
pic>java Test1


Hello world from Java


Exception in thread "main" java.lang.UnsatisfiedLinkError: check_string

at Test1.check_string(Native Method)

at Test1.main(Test1.java:16)









Can i add any extra in this programme?

Give me a suggestion.




Thanks & Regards

Jana.    <<Less

Re: Calling VB dll function from Java

Posted By:   Robert_Lybarger  
Posted On:   Friday, June 23, 2006 07:33 AM

And you have done the JNI hokey pokey to get stubs/skeletons created from your java source and added the necessary bits to the dll file, right? (Meaning: if you only did the things you posted, it can't work.)
About | Sitemap | Contact