Article View: borland.public.jbuilder.java.api
Article #3437Re: Calling Delphi DLL's
From: Paul Whittington
Date: Tue, 13 Jan 1998 00:00
Date: Tue, 13 Jan 1998 00:00
102 lines
2926 bytes
2926 bytes
This is a multi-part message in MIME format.
--------------15652545C3343DF4231F2814
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
- First go get the Port of Netscape Plugin / LiveConnect SDK V30b5 to
Delphi 2,3 at
http://www.geocities.com/SiliconValley/Pines/7004/DLPEPAGE.HTM
- Second write and compile a Java class that looks something like this
public class HelloNative
{
public native static void greeting();
static
{
System.loadLibrary ("HelloNative");
}
}
that declares a native method, in this case greeting, and provides static
initialization code that will load the DLL using System.loadLibrary.
- Third follow the directions on how to run javapas and run it against the
.class file you just created.
- Forth add a procedure in the generated code that looks something like
this
procedure native_HelloNative_greeting(_EE_: PJRIEnv; p:pointer);
begin
writeln('Hello, Native World!');
end;
that implements the native method.
- Fifth build a Delphi DLL by using code that looks something like
library HelloNative;
uses
SysUtils,
Classes,
Jri in '..\Jri.pas',
Jri_md in '..\Jri_md.pas',
Jritypes in '..\Jritypes.pas',
UHelloNative in '..\UHelloNative.pas';
exports
Java_HelloNative_greeting_stub;
begin
end.
- Sixth build a Java main program that calls the native method that looks
something like this
public class HelloNativeTest
{
public static void main (String[] args)
{
HelloNative.greeting ();
}
}
- Finally run the main program.
TTFN Paul
cliff wrote:
> Does anyone have an example of how to call a Delphi DLL or ActiveX from
> Jbuilder?
> Any help would be appreciated.
>
> Cliff
--------------15652545C3343DF4231F2814
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Paul Whittington
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Paul Whittington
n: Whittington;Paul
org: Idaho National Engineering and Environmental Laboratory
email;internet: paul@sage.inel.gov
title: Advisory Engineer
x-mozilla-cpt: ;0
x-mozilla-html: TRUE
version: 2.1
end: vcard
--------------15652545C3343DF4231F2814--
Technical Details
Message-ID:
<34BBCE95.BC85D180@sage.inel.gov>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<34BABBE2.AAFA3EB6@erols.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,f7978574be57d5a5 X-Google-Attributes: gid1089d0,public From: Paul Whittington <paul@sage.inel.gov> Subject: Re: Calling Delphi DLL's Date: 1998/01/13 Message-ID: <34BBCE95.BC85D180@sage.inel.gov> X-Deja-AN: 315636007 References: <34BABBE2.AAFA3EB6@erols.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------15652545C3343DF4231F2814" Organization: Idaho National Engineering and Environmental Laboratory Newsgroups: borland.public.jbuilder.java.api