>From your mail, I gather that u have some existing DLLs with u...then
the JNI becomes all the more simpler...

First create a servlet class :

public class nameofservlet extends...
{
        public native nameOfNativeMethod1( );
        public native nameOfNativeMethod2( );
................

}

compile it using javac
then run javah and then u will get  (nameofservlet.h)   file . In this
file u will get the signature of your methods generated by JAVAH....Use
it to write your JNI code either in C or C++...Note that in this JNI
code, u call the actual functions or APIs of the existing DLL file that
u have....COMPILE this JNI code and make it a NEW.DLL....linking it with
all the existing libraries that u have...
Finally load this DLL in the final JAVA application...using

public nameofclass
{
        static
        {
                System.loadLibrary("nameofDLL");  // Note that .dll
extension is not included
        {


...............
}


Love and cheeeeeeers,
Harkishin


Harkishin Nachnani,
MicroAutomation, Inc., 5160 Parkstone Drive, #140, Chantilly, VA 20151
Tel: (703) 378-7000 x609 Fax: (703) 378-4321
Web: www.microaut.com


> -----Original Message-----
> From: Rajneesh Garg [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, April 14, 2000 9:13 AM
> To:   [EMAIL PROTECTED]
> Subject:      Fw: JNI Problem : Existing C++ Code
>
> Hi there!
>
> I got your email id from Java Forum.
>
> I am working on Java Web Server 2.0 with SqlServer 7 as database. Its
> a Servlet/JSP based work.
> Here, we are to generate a number of templates based on the user
> input, which are being generated using VC++ components. There is
> already a VC++ component written for it. We have the DLLs and source
> code for it with us. The component is to accept user input and based
> on it, will generate some templates, in image format.
> I have been able to work with JNI using tutorials available. However,
> the problem is that all tutorials concentrate on one ascept i.e. we
> write code for the C or C++ function. However, in my case, the source
> code is already written. I wish to know how to proceed for it.
> As you have experienced with JNI, I wish to take your help for the
> problem mentioned.
>
> Any pointers/help code/tutorial locs will be highly appreciated.
>
> Platform : Java Web Server 2.0, Sun JVM 1.2.2, Windows NT 4.0
>
> Regards,
>
> Rajneesh Garg
>
> Keep Smiling. It does improve your face value. :-)

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to