@lazaru escreveu:
Boa tarde necessito passar passar um Array de structure segue códigos.
public class PW_GetData extends Structure { public static class ByReference extends PW_GetData implements Structure.ByReference {} public short wIdentificador = 0; public byte bTipoDeDado = 0; public byte[] szPrompt = new byte[84]; public byte bNumOpcoesMenu = 0; public byte[][] vszTextoMenu = new byte[20][41]; }
declaração da dll....
short PW_iExecTransac(PW_GetData[] pw_Data, IntByReference piNumParam);
passando parâmetro
IntByReference tam = new IntByReference(10); PGWebLib.PW_GetData.ByReference[] pw_Data = new PGWebLib.PW_GetData.ByReference[10]; for (int i=0;i<10;i++){ pw_Data[i] = new PGWebLib.PW_GetData.ByReference(); } ret = INSTANCE.PW_iExecTransac(pw_Data, tam);
Erro:
Caused by: java.lang.IllegalArgumentException: Function PW_iExecTransac declared Structure[] at parameter 0 but array of class br.com.load.dll.meu.deus.loaddll.PGWebLib$PW_GetData$ByReference was passed
at com.sun.jna.Function.convertArgument(Function.java:580)
at com.sun.jna.Function.invoke(Function.java:305)
at com.sun.jna.Library$Handler.invoke(Library.java:236)
at com.sun.proxy.$Proxy5.PW_iExecTransac(Unknown Source)
at br.com.load.dll.meu.deus.loaddll.FXMLController.handleButtonAction(FXMLController.java:78)
... 58 moreAlguém tem alguma ideia?
Mensagens: 3
Participantes: 2