2 messages in net.java.dev.jna.usersLinked List Usage
FromSent OnAttachments
Vito IngrassiaJul 16, 2007 10:13 am 
Timothy WallJul 16, 2007 12:05 pm 
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:Linked List UsageActions...
From:Vito Ingrassia (v.in@iwbank.it)
Date:Jul 16, 2007 10:13:41 am
List:net.java.dev.jna.users

Hello,

My C function is

int TradePullOrders(OrderIdList* pcOrderIdList);

with OrderIdList defined as linked list

typedef struct _tagOrderIdList { struct _tagOrderIdList* pcNext; long llOrderId; } OrderIdList;

My Java mapping is

public int TradePullOrders(OrderIdList pcOrderIdList);

with

public class OrderIdList extends Structure {

public Pointer pcNext = null; //with OrderIdList would be infinitely-sized structure and goes overflow public long llOrderId;

OrderIdList(long ll) { llOrderId = ll; } }

My question is: in order to use OrderIdList as only input parameter how can I create the linked list to pass in with several items in the list?

I'm trying this way

LiffeOrderIdList data = new LiffeOrderIdList(1); LiffeOrderIdList data1 = new LiffeOrderIdList(2); data.pcNext = data1.getPointer();

but i can't read the item 2 in C funtion.

thanks,

Vito