🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #17133

Re: Accessing a C++ dll

#17133
From: Steve Waters
Date: Fri, 11 Dec 1998 00:00
38 lines
1568 bytes
Hi there what you should do is check out the JNI interface this allows you to
connect to a c /c++ program.

Now if its a windows (i presume so) dll, what you should do is write a stub viz

loadlibary
then call the dll function

then return from your c/c++ program. Using this method, if you dont have the
source, as for any windows dll, you can still call it !!

Good luck

Steve


MarkL wrote:

> Hi,
>
>     I'm trying to write some Java code that accesses some methods in a C++
> Dll. The only way
> i've seen of doing this is to generate the .h and .c files using javah, and
> then amending the code
> in the dll.
>
> Is there a way to directly 'import' the dll without having to change to C++
> code to include the genrated header file, as the source code may not always
> be available.
>
> All the texts i have read seem to point to the 'javah' method. There must be
> another way???
>
> Thanks
>
> Mark
>
> (Also any links to sites about this topic would be helpful)
Technical Details
Message-ID: <3671DD8C.8AA4D452@bellsouth.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <74s6ie$gp314@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,fd1d79e26c0f9583
X-Google-Attributes: gidf74b3,public
From: Steve Waters <steve_w@bellsouth.net>
Subject: Re: Accessing a C++ dll
Date: 1998/12/11
Message-ID: <3671DD8C.8AA4D452@bellsouth.net>
X-Deja-AN: 421409137
Content-Transfer-Encoding: 7bit
References: <74s6ie$gp314@forums.borland.com>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language