3 messages in net.java.dev.jna.usersRe: [jna-users] Mapping Pointer to Po...
FromSent OnAttachments
Ulisses CarvalhoJul 10, 2008 10:46 pm 
Timothy WallJul 10, 2008 11:17 pm 
Ulisses CarvalhoJul 11, 2008 9: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] Mapping Pointer to Pointer ArrayActions...
From:Timothy Wall (twal@dev.java.net)
Date:Jul 10, 2008 11:17:11 pm
List:net.java.dev.jna.users

A native C array is nothing more than a block of memory. You need to use Pointer.getPointerArray() to convert to a Java array of Pointer.

On Jul 11, 2008, at 1:46 AM, Ulisses Carvalho wrote:

Hi,

I need mapping this structure:

===================================== typedef struct _wfs_cdm_cu_info { USHORT usTellerID; USHORT usCount; LPWFSCDMCASHUNIT * lppList; } WFSCDMCUINFO, * LPWFSCDMCUINFO;

typedef struct _wfs_cdm_cashunit { USHORT usNumber; USHORT usType; LPSTR lpszCashUnitName; CHAR cUnitID[5]; CHAR cCurrencyID[3]; ULONG ulValues; ULONG ulInitialCount; ULONG ulCount; ULONG ulRejectCount; ULONG ulMinimum; ULONG ulMaximum; BOOL bAppLock; USHORT usStatus; USHORT usNumPhysicalCUs; LPWFSCDMPHCU * lppPhysical; } WFSCDMCASHUNIT, * LPWFSCDMCASHUNIT; =====================================

In this case lppList is a Pointer to an array of pointers to cash unit structures.

How can mapping this?

If you don't actually need to use the field, just declare it as Pointer.