7 messages in net.java.dev.jna.usersRE: [jna-users] callback function poi...
FromSent OnAttachments
fixf...@online.deMay 20, 2008 2:38 am 
Johannes RollenbeckMay 20, 2008 3:39 am 
Timothy WallMay 20, 2008 5:32 am 
Johannes RollenbeckMay 20, 2008 7:41 am 
Johannes RollenbeckMay 20, 2008 7:58 am 
Timothy WallMay 20, 2008 7:58 am 
Johannes RollenbeckMay 21, 2008 12:14 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] callback function pointer inside structActions...
From:Johannes Rollenbeck (fixf@online.de)
Date:May 20, 2008 7:41:08 am
List:net.java.dev.jna.users

Timothy, thanks for the quick answer.

You are right, the short / int issue came in because of the simplifications I made for posting. It's really int.

Here is my C implementation of callCallback():

int callCallback(REQ_PEND *req_out) { if( req_out ) { if( req_out->req_done ) return req_out->req_done( req_out ); return 8888; } return 7777; }

Everything I've tried so far results in 8888, so req_done seems to be NULL. When calling callCallback2 JNA obviously takes the address of the CBrequestDone's function 'callback' and passes it to the library. Is this also carried out, when 'req_pend.req_done = new CBrequestDone();' is carried out? With Structure there is a difference when used as parameter or as member of a Structure (ByReference vs. ByValue). May there be something similar with Callback?

Regards, Johannes