Article View: borland.public.jbuilder.java.language
Article #15744Re: Calling existing dlls from Java
From: lbthorne
Date: Wed, 05 May 1999 00:00
Date: Wed, 05 May 1999 00:00
21 lines
1634 bytes
1634 bytes
In article <372FDEE2.15FE3A2B@CompuServe.com>, Jens Kaspareit <100073.3642@CompuServe.com> wrote: > Can anybody tell me how to call functions from an existing dll which can > not be > modified? I always find examples for which you have to write special C > code in the dll source, although the JNI documentation says at the > beginning that it is also > made for calling existing dlls. > Thank you > > Unless you're unbelievably lucky in the format that the existing functions use, you'll have to write a "bridge" DLL. I just did a project that needed to call CPI-C functions from a purchased DLL (CPIC.DLL) in Java. I had to create a "bridge" DLL called (JNICPIC.DLL) that could be invoked by Java and would then massage the Java passed parameters (Jstring to C string, etc.) before invoking the "real" function from CPIC.DLL....lbt -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
Technical Details
Message-ID:
<7gq218$viv$1@nnrp1.deja.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<372FDEE2.15FE3A2B@CompuServe.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,caee776bb457535c X-Google-Attributes: gidf74b3,public From: lbthorne@my-dejanews.com Subject: Re: Calling existing dlls from Java Date: 1999/05/05 Message-ID: <7gq218$viv$1@nnrp1.deja.com> X-Deja-AN: 474390631 References: <372FDEE2.15FE3A2B@CompuServe.com> X-Http-Proxy: 1.0 x5.dejanews.com:80 (Squid/1.1.22) for client 209.57.148.228 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Wed May 05 18:11:14 1999 GMT Newsgroups: borland.public.jbuilder.java.language X-Http-User-Agent: Mozilla/4.51 [en] (Win95; U)