

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
24 messages in net.java.dev.jna.usersRe: [jna-users] Re: Mapping Struct to...| From | Sent On | Attachments |
|---|---|---|
| thex...@email.com | Nov 1, 2008 1:46 am | |
| Timothy Wall | Nov 1, 2008 5:04 am | |
| thex...@email.com | Nov 1, 2008 8:40 am | |
| Timothy Wall | Nov 1, 2008 11:14 am | |
| Timothy Wall | Nov 1, 2008 11:17 am | |
| thex...@email.com | Nov 2, 2008 12:30 am | |
| Timothy Wall | Nov 2, 2008 7:42 am | |
| thex...@email.com | Nov 3, 2008 2:02 am | |
| Timothy Wall | Nov 3, 2008 3:49 am | |
| thex...@email.com | Nov 3, 2008 4:51 am | |
| Timothy Wall | Nov 3, 2008 6:22 am | |
| thex...@email.com | Nov 3, 2008 7:47 am | |
| Timothy Wall | Nov 3, 2008 8:21 am | |
| thex...@email.com | Nov 3, 2008 11:19 pm | |
| Timothy Wall | Nov 4, 2008 5:33 am | |
| Timothy Wall | Nov 4, 2008 5:34 am | |
| thex...@email.com | Nov 4, 2008 2:33 pm | |
| Timothy Wall | Nov 5, 2008 5:44 am | |
| thex...@email.com | Nov 5, 2008 8:15 am | |
| Timothy Wall | Nov 5, 2008 9:19 am | |
| thex...@email.com | Nov 5, 2008 3:22 pm | |
| Timothy Wall | Nov 5, 2008 7:00 pm | |
| thex...@email.com | Nov 6, 2008 3:36 am | |
| thex...@email.com | Nov 6, 2008 10:55 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread Paste this link in email or IM: |
| Atom feed for this thread Paste this URL into your reader: |
| Subject: | Re: [jna-users] Re: Mapping Struct to Java | Actions... |
|---|---|---|
| From: | thex...@email.com (thex...@email.com) | |
| Date: | Nov 2, 2008 12:30:08 am | |
| List: | net.java.dev.jna.users | |
Hi
Thank you so much for your hints. I wouldn't know what to do without them. I
simply
reached the limit of my knowledge universe.
One other thing to check is whether FFACE_API is defined as "__stdcall"; if so you need to use StdCallLibrary instead of Library to ensure the proper calling convention is used. This is another thing that could cause a crash.
Did not find anything special. This pre-compiler commands are all thats in the
header
file besides struct's and function calls.
#ifndef FFACE_API_EXPORTS # define FFACE_API __declspec(dllimport) #else # define FFACE_API __declspec(dllexport) #endif
Is there any way to "extract" information about the functions and structs from
the
corresponding library FFACE.lib? I got the dll, the header file and the library.
As
a matter of fact the header is not complete and outdated I guess probably nobody
is
using it. I found a C# file that defines all function calls including the one of
the
header file plus about 30 more than that.
See what "sizeof(INVENTORYITEM)" returns in C#, and ensure that Structure.size() returns the same thing in Java. If there are any #pack directives in the header to change the structure layout, it might also cause the size to be different than the default.
sizeof() not usuable on INVENTORYITEM - it says INVENTORYITEM does not have a
fixed size.
Had to determine the size of the return value with
System.Runtime.InteropServices.Marshal.SizeOf().
The estimation in Java resulted in a size of 4 - C# told me the same value.
I did start using Native.setProtected(true) - either because of this or because
of multiple tests
done in a short period I had to encounter that the returned structure may
contain random values.
Up to 5 runs out of 10 features random negative numbers in the return value.
The C compiler automatically generates the second argument if you omit it. JNA will do no such thing, so your declaration of the function *must* include the second argument.
Oh, I see. Thanks for explaining.
Regards, Armin
-- See Exclusive Video: Hollywood Life's 5th Annual Style Awards http://www.hollywoodlife.net/Awards.aspx?AwardsID=style2008







