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).