I'm having problems when trying to use two functions of a DLL in Delphi with the JNA Java. In Test Software (Delphi, provided with DLL by ), I have this functions (working perfectly in test software):
function abrir_conexao (const modelo : **byte**; const host : **pansichar**; const porta : **word**; const senha : **pansichar**) : integer; stdcall external 'comunicacao.dll';
function enviar_comando (const comando : **byte**; var tamanho : **byte**; var dados : **pbyte**) : integer; stdcall external 'comunicacao.dll';
I'm trying to implement these functions in Java (JNA). I'm getting usually load the dll , however , I believe that the problem lies in the use of correct primitive variables:
public int abrir_conexao (**byte** modelo, **String** host, **short** porta, **String** senha);
public int enviar_comando(**byte** comando, **byte** tamanho, **byte[]** dados);
But it's not working. Can anyone help ?
For the following native functions:
JNA mapping: