2 messages in net.java.dev.jna.usersRe: [jna-users] Inline array of class...
FromSent OnAttachments
Clovis de Oliveira Leoncio Pinheiro JuniorOct 16, 2008 2:16 pm 
Timothy WallOct 16, 2008 3:50 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:Re: [jna-users] Inline array of class java.lang.String not supportedActions...
From:Timothy Wall (twal@dev.java.net)
Date:Oct 16, 2008 3:50:53 pm
List:net.java.dev.jna.users

On Oct 16, 2008, at 5:16 PM, Clovis de Oliveira Leoncio Pinheiro Junior wrote:

I'm trying to map the following structure:

typedef struct _wfs_chk_in_process_form { LPSTR lpszFormName; LPSTR lpszMediaName; LPSTR lpszInputFields; LPSTR lpszOutputFields; LPWSTR lpszUNICODEOutputFields; DWORD dwOptions; } WFSCHKINPROCESSFORM, * LPWFSCHKINPROCESSFORM;

LPSTR is equivalent to char**. A sample definition from the DLL provider is: lpszInputFields Pointer to a list of null-terminated field names from which to read input data, with the final name terminating with two null characters.

When I'm trying to map this field as String[] I get a "Inline array of class java.lang.String not supported" error. Any Idea?

You want a Pointer field, not an inline array.

You can use StringArray to initialize a block of char* in native memory; the field would then need to be of type Pointer. StringArray automatically NULL-terminates the list of strings. You'll need to manually invoke StringArray.read() in order to update the contents after they've been changed by native code.