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
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
"In the country of the blind, the one eyed man is the King"
Gautham Kasinath CV at : http://www.geocities.com/gkasinath
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
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?
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
"In the country of the blind, the one eyed man is the King"
Gautham Kasinath CV at : http://www.geocities.com/gkasinath