Can you provide what the (simplest) usage should look like in C?
Thanks,
T.
On May 16, 2007, at 10:09 AM, Jean-Baptiste Bugeaud wrote:
Hello all,
I am trying to access the GetRawInputDeviceList from Windows's
User32.dll
see http://msdn2.microsoft.com/en-us/library/ms645598.aspx
What is the prefered equivalence of the p/invoke
Marshal.PtrToStructure under JNA ? IE, getting a Structure from a raw
Pointer, enabling some pointer computation to get an structure array,
given a number of element ?
I am able to access the pRawInputDeviceList "array" using a Memory
with signature :
int GetRawInputDeviceList(Pointer pRawInputDeviceList, IntByReference
puiNumDevices, int cbSize); doing manual field access (direct offset
computing)... working, but very painfull and dumping lots of interrest
of using JNA :(
But neither accesing with a Structure like :
int GetRawInputDeviceList(RAWINPUTDEVICE pRawInputDeviceList,
IntByReference puiNumDevices, int cbSize);
nor with an array structure like :
int GetRawInputDeviceList(RAWINPUTDEVICE[] pRawInputDeviceList,
IntByReference puiNumDevices, int cbSize);
is working (assuming the array is filled to the right size) !
When passing a Structure, I am able to get the first one (of index 0),
but requesting toArray() on the Structure would then fail (even making
the underlying memory of the structure allocated to the array required
size).
Any ideas/solutions ?
Second question, is there any formal plan to integrate nlink to JNA ?
IE, use annotations, genericity ... to get simpler and more intuitive
code ?
Last question, coud you provide the sources and the javadocs as JAR
files on the website ? This would be very handy ;-)
Regards,
Jean-Baptiste BUGEAUD