13 messages in net.java.dev.jna.usersRe: [jna-users] Cannot pass any data ...
FromSent OnAttachments
Daniel HorowitzJun 14, 2007 11:27 am 
Timothy WallJun 14, 2007 11:29 am 
Daniel HorowitzJun 14, 2007 11:31 am 
Daniel HorowitzJun 14, 2007 11:39 am 
Timothy WallJun 14, 2007 11:42 am 
Daniel HorowitzJun 14, 2007 11:52 am 
Timothy WallJun 14, 2007 11:53 am 
Timothy WallJun 14, 2007 12:03 pm 
Daniel HorowitzJun 14, 2007 12:13 pm 
Daniel HorowitzJun 14, 2007 12:22 pm 
Timothy WallJun 14, 2007 12:30 pm 
Daniel HorowitzJun 14, 2007 2:11 pm 
Timothy WallJun 14, 2007 2:23 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] Cannot pass any data to native dllActions...
From:Timothy Wall (twal@dev.java.net)
Date:Jun 14, 2007 2:23:37 pm
List:net.java.dev.jna.users

On Jun 14, 2007, at 5:11 PM, Daniel Horowitz wrote:

Timothy,

Ok. Things are sort of working now.

I upgraded to trunk, changed my interface to extend Library and I can call my function with ints and strings (sweet).

I foresee a problem though. I need to register a callback to my dll function. This callback will be a java function. In your example on the home-page, the interface extends StdCallLibrary.

It only extends StdCallLibrary because that's what the underlying library required. If yours doesn't, then Library/Callback is sufficient. The only reason StdCallX is there is to support libraries that use the stdcall convention.

This is what got me in trouble in the first place. If I decorate my functions with __stdcall the trunk version of jna cant find my functions. Exactly how should i declare and expose my functions such that jna can find them with StdCallLibrary?

Thanks again your help, Dan H

Again, if you *do* use a library that uses the stdcall convention, there is a mapping object StdLibrary.FUNCTION_MAPPER that can be passed in to Native.loadLibrary's option map. This mapper auto- generates the right function names (see the javadoc for Native.loadLibrary, FunctionMapper, and StdCallLibrary).