Article View: borland.public.jbuilder.java.api
Article #1447Re: Linking jbuilder 6 to dll file
From: Joi Ellis [TeamB]
Date: Mon, 28 Jan 2002 15:42
Date: Mon, 28 Jan 2002 15:42
57 lines
2735 bytes
2735 bytes
chris <tborg1@bigpond.net.au> wrote:
> Hello
> I was wondering if anyone out there would know how to link jbuilder to dll
> file. I am trying to access the parallel ports on NT and XP computers and
> had to write an dll in c++ to read and write to and from the LPT1 port
> (becuase I was having trouble getting the inputstream to read bytes from
> parallel port using Java communication API, and after couple weeks of trying
> gave up on that approach).
> The class I wrote is a simple one and here code I used in jbuilder
> public class accessport {
> public accessport ( int portBase )
> {
> this.portBase = portBase;
> }
> /** Initialize the port */
> public boolean Initialize(){
> return accessport.StartInitialize();
> }
> public static native boolean StartInitialize();
> static
> {
> System.loadLibrary("winio");
> }
> }
> When I complie the program there no error, but when I try to run
> Initialize() I get an
> Exception occurred during event dispatching:
> java.lang.UnsatisfiedLinkError: StartInitialize
> I was wondering if anyone known what I need to do to get dll program to
> work....
> Thanks
> Hope someone can help me
You need to place your dll somewhere where the JVM can find it.
This could be c:\Winnt\System32, or it could be elsewhere if you tell
the JVM where to look using the -Djava.library.path VM Parameter in
Project Properties | Run. See here for more info:
http://www.visi.com/~gyles19/cgi-bin/fom.cgi?file=95
--
Joi Ellis (TeamB) http://www.teamb.com/
No direct email, please.
For best results, post on news server newsgroups.borland.com!
Newsgroup Guidelines: http://www.borland.com/newsgroups/guide.html
Only posts which violate the rules in guide.html are subject to cancelation.
Technical Details
Message-ID:
<3c557163_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!193.251.151.101!opentransit.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnews!not-for-mailReferences:
<3c534d54_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,22ca4dfc0309ea8f
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2002-01-28 07:45:08 PST
Sender: Joi Ellis <joi@artoo.gyles19.visi.com>
Message-ID: <3c557163_1@dnews>
From: "Joi Ellis [TeamB]" <joi@aravox.com>
Subject: Re: Linking jbuilder 6 to dll file
Newsgroups: borland.public.jbuilder.java.api
References: <3c534d54_2@dnews>
User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) (Linux/2.2.19-6.2.7 (i686))
NNTP-Posting-Host: 209.98.6.107
Date: 28 Jan 2002 07:42:28 -0800
X-Trace: dnews 1012232548 209.98.6.107 (28 Jan 2002 07:42:28 -0800)
Lines: 57
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!news.tele.dk!small.news.tele.dk!193.251.151.101!opentransit.net!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!dnews!not-for-mail