1 message in net.java.dev.jna.users[jna-users] Re: unsigned char ***pdat...
FromSent OnAttachments
Timothy WallOct 25, 2008 11:43 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:[jna-users] Re: unsigned char ***pdata parse problemActions...
From:Timothy Wall (twal@dev.java.net)
Date:Oct 25, 2008 11:43:23 am
List:net.java.dev.jna.users

Please direct future replies to the JNA users list.

On Oct 25, 2008, at 1:48 PM, Alejandro Vouilloz wrote:

Hi Timothy:

Im from Argentine and my english is very poor.

I have a function with follow signature:

int nfseg_primitive( unsigned char *data, int w, int h, unsigned char ***pdata, seg_rec_coords** fing_boxes ) ;

The arg pdata is a output param, a pointer by reference to array of image.

In JNA i parse this function like:

public int nfseg_primitive( byte[] data, int w, int h, PointerByReference pdata, //Retorno Seg_rec_coords.ByReference[] fing_boxes );

And i usage like:

PointerByReference pdata = new PointerByReference(); ... ret = nfseg.nfseg_primitive(data, w, h, pdata, boxes);

Here the jvm execution abort because the c funtion can't alloc memory of unsigned char.

My question is:

I parse this param unsigned char ***pdata correctly or not?

Yes, you have mapped that part correctly. How does the function fail? What does the JVM error log say?

Thanks for you time.

PD: JNA is amazing :-)

Thanks!