JNA-Mapping Delphi Function

Posted by Florian on Stack Overflow See other posts from Stack Overflow or by Florian
Published on 2009-09-25T07:22:08Z Indexed on 2010/03/26 14:03 UTC
Read the original article Hit count: 574

Filed under:
|
|
|

Hi!

How do i map this function with JNA:

Delphi code:

function getData(InData1: PChar; 
                 InData2: PChar; 
                 Data: TArray16; 
                 var OutData1: PChar; 
                 var OutData2: PChar): integer; stdcall;

with: TArray16 = array[0..15] of char;

The int value that is returned can be 0 for Error or 1 for right execution;

My suggestion is:

Java code:

int getData(String inData1, 
            String inData2, 
            byte[] data, 
            byte[] outData1
            byte[] outData2);

The problem is that the function of the dll returns 0. I also tried other Datatypes, but it hasn't worked jet. I think the problem is that the dll function can't write to the parameters outData1 and outData2.

Who can help me?....Thanks!!

© Stack Overflow or respective owner

Related posts about java

Related posts about jna