2 messages in net.java.dev.jna.usersRe: [jna-users] Re : [jna-users] stru...
FromSent OnAttachments
amina guermoucheOct 22, 2008 9:04 am 
Paul LoyOct 22, 2008 9:22 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] Re : [jna-users] struct **** as argumentActions...
From:Paul Loy (kete@gmail.com)
Date:Oct 22, 2008 9:22:15 am
List:net.java.dev.jna.users

so mesh_t **** is a pointer to a multidimensional array of mesh_t structures, or a portion of memory. Is there a utility function in the library for initialising a mesh_t ****? If so use that. If not, it gets a lot more difficult as we'll have to use Memory, but that needs to be the right size!

Where, if you were writing this in native (C) code, would you have gotten 'a' from? That's where you need to get it from in JNA too.

Showing us an actual use case in native code is very useful!

i.e. in native code:

mesh_t **** mesh_array = SOME_FUNCTION_CALL_OR_INITIALIZATION_HERE; bunch_of_ray(mesh_array);

what is SOME_FUNCTION_CALL_OR_INITIALIZATION_HERE?

Paul.

On Wed, Oct 22, 2008 at 5:04 PM, amina guermouche <guer@yahoo.fr>wrote:

How do I initialize a Pointer? Whenever I use Pointer a and then call a function that has a as a parameter, I have an error about initialization of the pointer. Thanks.

------------------------------ *De :* Paul Loy <kete@gmail.com> *À :* use@jna.dev.java.net *Envoyé le :* Mercredi, 22 Octobre 2008, 17h40mn 22s *Objet :* Re: [jna-users] struct **** as argument

Pointer looks like the one to use here.

On Wed, Oct 22, 2008 at 4:35 PM, amina guermouche <guer@yahoo.fr>wrote:

Hie, I have a C structure called mesh_t. It's used as a mesh_t **** a and is an argument of a function I need to call from JAVA: void bunch_of_ray(struct mesh_t ****a)

I don't know how to write this function in JAVA (if it was just a struct * mesh_t I'd have passed the structure direclty). Thank You.