I am trying to access a dll through JNA.
the dll contains a method
I am new to JNA. I tried to went through the tutorials and examples. so far I've understood is- I have done the following thing:
the opensamplesystem() method executes and returns 0 which, according to the dll documentation, is ok.
but the problem is with the startsamplesystem(HWND wid, int mid, int devices, int protocol, int message) where I am not sure how to map HWND data type from my code.
In short, HWND is another name for HANDLE which is another name for PVOID which is another name for void*, or a pointer of any type.
Well, that is one possible type definition. I've checked my MinGW's windef.h. It says that DECLARE_HANDLE is a macro from winnt.h with two possible definitions:
The second is what's described above: HWND is HANDLE is PVOID is void*. The first still says that HANDLE is void* but without the intermediate PVOID. HWND though is a pointer to a struct with one int element (if my C knowledge doesn't desert me). Not exactly the same.
Still, in the end there is one common type: a generic pointer. I think you can use the Pointer class for that.