🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #3203

JNI - Null pointer exeption

#3203
From: Eduard Andre
Date: Mon, 09 Mar 1998 00:00
98 lines
4023 bytes

--------------A1D43857FA9FBEB9D953FEA9
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I need help urgent.
Problem:
I have created a DLL in Visual C++, which reads data from DataFlex
files. I use this DLL with a JBuilder App, which represents the whole
UI.
If  I start the application an call the external functions, I always get
a NullPointer- Exception. If I start the same App in JBuilders debug
mode everything works great.

Have anybody an idea what happens.

here are a code fragment:

  void mnuTest1_actionPerformed(ActionEvent e) {
    long      timed;
    int       rcount = 0;
    long      fHandle;
    int       err = 0;

    statusBar.setText("");
    fHandle = dfDLL.dfOpenFile("D:\\RT97\\KUN.DAT", 0);  <<< works fine
    timed = System.currentTimeMillis();
    while (dfDLL.dfRecordFind(fHandle,1,4) == 0) {       <<<<
NullPointerExcetion
      rcount++;
    }
    txtAnzahl.setText(java.lang.Integer.toString(rcount));
    txtCount.setText(dfDLL.dfFieldGetString(fHandle,1));
    timed = (System.currentTimeMillis()- timed);
    statusBar.setText(java.lang.Long.toString(timed)+" MilliSekunden");
    dfDLL.dfCloseFile(fHandle);
  }

It seems it's a timing problem, but I don't no why.

At the moment whe have only an email adress for the whole company. If
anybody send me an answer please add my name.

Many thanks
Eduard Andre


--------------A1D43857FA9FBEB9D953FEA9
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
I need help urgent.
<BR><B><U>Problem</U></B>:
<BR>I have created a DLL in Visual C++, which reads data from DataFlex
files. I use this DLL with a JBuilder App, which represents the whole UI.
<BR>If&nbsp; I start the application an call the external functions, I
always get a NullPointer- Exception. If I start the same App in JBuilders
debug mode everything works great.

<P>Have anybody an idea what happens.

<P>here are a code fragment:

<P>&nbsp; void mnuTest1_actionPerformed(ActionEvent e) {
<BR>&nbsp;&nbsp;&nbsp; long&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; timed;
<BR>&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rcount =
0;
<BR>&nbsp;&nbsp;&nbsp; long&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fHandle;
<BR>&nbsp;&nbsp;&nbsp; int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; err = 0;
<BR>&nbsp;
<BR>&nbsp;&nbsp;&nbsp; statusBar.setText("");
<BR>&nbsp;&nbsp;&nbsp; fHandle = dfDLL.dfOpenFile("D:\\RT97\\KUN.DAT",
0);&nbsp; <B><FONT COLOR="#3333FF">&lt;&lt;&lt; works fine</FONT></B>
<BR>&nbsp;&nbsp;&nbsp; timed = System.currentTimeMillis();
<BR>&nbsp;&nbsp;&nbsp; while (dfDLL.dfRecordFind(fHandle,1,4) == 0) {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<B><FONT COLOR="#FF0000">&lt;&lt;&lt;&lt; NullPointerExcetion</FONT></B>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rcount++;
<BR>&nbsp;&nbsp;&nbsp; }
<BR>&nbsp;&nbsp;&nbsp; txtAnzahl.setText(java.lang.Integer.toString(rcount));
<BR>&nbsp;&nbsp;&nbsp; txtCount.setText(dfDLL.dfFieldGetString(fHandle,1));
<BR>&nbsp;&nbsp;&nbsp; timed = (System.currentTimeMillis()- timed);
<BR>&nbsp;&nbsp;&nbsp; statusBar.setText(java.lang.Long.toString(timed)+"
MilliSekunden");
<BR>&nbsp;&nbsp;&nbsp; dfDLL.dfCloseFile(fHandle);
<BR>&nbsp; }

<P>It seems it's a timing problem, but I don't no why.

<P>At the moment whe have only an email adress for the whole company. If
anybody send me an answer please add my name.

<P>Many thanks
<BR><B>Eduard Andre</B>
<BR>&nbsp;</HTML>

--------------A1D43857FA9FBEB9D953FEA9--
Technical Details
Message-ID: <350410F3.296C69D6@aon.at>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,abf8afec4bf3b834,start
X-Google-Attributes: gid1089d0,public
From: Eduard Andre <vendare@aon.at>
Subject: JNI - Null pointer exeption
Date: 1998/03/09
Message-ID: <350410F3.296C69D6@aon.at>
X-Deja-AN: 332293608
Content-Type: multipart/alternative; boundary="------------A1D43857FA9FBEB9D953FEA9"
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.api