Forums Register Login

how to invoke a dll

+Pie Number of slices to send: Send
in java can i invoke a dll which is written for a vc++ program. this dll is used for encrypting and dcrypting now can i invoke this dll in java and try to use the method of it which decrypts. if yes then how to go bout it
+Pie Number of slices to send: Send
to call the dll and load it on to memory u will need to use the JNI method system.loadLibrary();
here is an example code for the same
I hope it helps
Regds
Gautham Kasinath
+Pie Number of slices to send: Send
So what i get from the example u have shown is that v need to have all the methods in the dll to be declared with the access modifier as native in our java program, and if the method accepts parameters v need to send the parameters from the navite method ?
kindly correct me if i am wrong.
tnx
srinath
+Pie Number of slices to send: Send
Hi!
Well yeah! u r on de rite track..
Is it someting else dat u r lookin for?? )
Regds
Gautham Kasinath
+Pie Number of slices to send: Send
now in fact i am even more confused b'coz when i declare the method native how does my prg going to check if the method is present in the dll or not what happens if their is some type mismatch or some thing of that sought?
and can this dll be written even in vb? or can i invoke even a VB dll?
+Pie Number of slices to send: Send
Hi!
Well there are certain rules when adhering to JNI.. some of these force the programmers to use the same method name and arguments and return types as the Java Code defined has declared.
This leaves very less room for errors if any..
here is a sample code for the c program that I used

further I used a command line compilation to make the same a dll.
The HelloWorld.h is a javah generated header file. run javah on the class file created for the Java Source.
I hope this helps
Regds
Gautham Kasinath
If somebody says you look familiar, tell them you are in porn. Or in these tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1640 times.
Similar Threads
invoking vb dll functions in java
Calling VB Dll In JAVA
how to run dll using java
Loading DLL in eclipse
Java and DLL's
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:33:46.