2 messages in net.java.dev.jna.usersRe: [jna-users] JNA and Delphi Windows
FromSent OnAttachments
Theuns HeydenrychAug 21, 2008 11:30 pm 
Timothy WallAug 22, 2008 6:52 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] JNA and Delphi WindowsActions...
From:Timothy Wall (twal@dev.java.net)
Date:Aug 22, 2008 6:52:06 am
List:net.java.dev.jna.users

You probably need to process and dispatch w32 events related to the delphi window (a modal window usually automatically processes it's own events in the "show" call).

See the keyboard hook example in the "contrib" area of SVN; there's an example of using a windows message queue.

On Aug 22, 2008, at 2:30 AM, Theuns Heydenrych wrote:

HI I am new to Java and would like to use a Delphi form in my Java project. I looked at the JNI route, and the latest JNI.pas libs are a bit old and I don’t know if it is compatable with Java 6.0.

I then looked at JNA and in a short space of time could launch the Delphi form from a Delphi win32 dll and set callbacks to the Java application and could get feedback from theDelphi form in the java out put. I was very impressed with JNA , and the work involved was easy to implement and to understand.

Then I hit a brick wall. I created a JFrame with a few JButtons and JLabels to launch the Delphi window with and to reflect the data in the JLabels that was received in the callbacks from the Delphi Window. I did not work. If I show the Delphi window modal from the dll , it behaves very nice , it (the Delphi Window) updates and repaints , but now , data is received in the Java Form for display , when the Delphi Window closes the callback data gets to the Java window.

So the next step is to show the Delphi window not in modal , and then it seems that the Delphi window is hanging , its non responsive , does not repaint and does not want to close.

What is happening here? Can anybody shed some light on this?

I really would like to get this working as a interim solution, while we get all our legacy software over to Java.