How to use a DLL created using VB in Java?
- From: "Srikanth" <sri1025@xxxxxxxxx>
- Date: 30 Sep 2005 08:50:59 -0700
Hi,
I want to know how to uses a DLL in java.... For that I created a
simple ActiveX dll using VB 6... The following is the code that I have
inside that... I named the DLL Sample.dll....
--------------------------------------------
public function returnInteger() as Integer
returnInteger = 10
end function
--------------------------------------------
I named the DLL as Sample.dll and I copied it to system32 folder of
windows...
This is only for to test... I want to know how to call this is a Java
program... I made some search and wrote this java code...
---------------------------------------------------------
public class CallNative {
public native int returnInteger();
static {
System.loadLibrary("Sample");
}
public static void main(String[] args) {
CallNative nativeObj = new CallNative();
System.out.println(nativeObj.returnInteger());
}
}
---------------------------------------------------------
The following is the error that I'm getting....
------------------------------------------------------------
java.lang.UnsatisfiedLinkError: add
at com.srikanth.callnative.CallNative.returnInteger(Native Method)
at com.srikanth.callnative.CallNative.main(CallNative.java:15)
Exception in thread "main"
------------------------------------------------------------
What should I do to access the returnInteger() function that I wrote
using VB??? I found that I should have a wrapper class and blah blah,
can anyone help me to call this simple method so that I can use my
other DLL that are written using VB (this is what I want to do in the
end).... Thank you very much for spending time to read this, please
help me if you know how to do it... Thank you once again
--Srikanth
.
- Follow-Ups:
- Re: How to use a DLL created using VB in Java?
- From: Roedy Green
- Re: How to use a DLL created using VB in Java?
- Prev by Date: Re: How often does a Java Web Start application update itself?
- Next by Date: Re: Exception in thread "main" java.lang.NoClassDefFoundError
- Previous by thread: Re: Book Recommendation
- Next by thread: Re: How to use a DLL created using VB in Java?
- Index(es):
Relevant Pages
|