24 messages in net.java.dev.jna.usersRe: [jna-users] Re: Mapping Struct to...
FromSent OnAttachments
thex...@email.comNov 1, 2008 1:46 am 
Timothy WallNov 1, 2008 5:04 am 
thex...@email.comNov 1, 2008 8:40 am 
Timothy WallNov 1, 2008 11:14 am 
Timothy WallNov 1, 2008 11:17 am 
thex...@email.comNov 2, 2008 12:30 am 
Timothy WallNov 2, 2008 7:42 am 
thex...@email.comNov 3, 2008 2:02 am 
Timothy WallNov 3, 2008 3:49 am 
thex...@email.comNov 3, 2008 4:51 am 
Timothy WallNov 3, 2008 6:22 am 
thex...@email.comNov 3, 2008 7:47 am 
Timothy WallNov 3, 2008 8:21 am 
thex...@email.comNov 3, 2008 11:19 pm 
Timothy WallNov 4, 2008 5:33 am 
Timothy WallNov 4, 2008 5:34 am 
thex...@email.comNov 4, 2008 2:33 pm 
Timothy WallNov 5, 2008 5:44 am 
thex...@email.comNov 5, 2008 8:15 am 
Timothy WallNov 5, 2008 9:19 am 
thex...@email.comNov 5, 2008 3:22 pm 
Timothy WallNov 5, 2008 7:00 pm 
thex...@email.comNov 6, 2008 3:36 am 
thex...@email.comNov 6, 2008 10:55 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] Re: Mapping Struct to JavaActions...
From:Timothy Wall (twal@dev.java.net)
Date:Nov 1, 2008 11:14:49 am
List:net.java.dev.jna.users

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.

On Nov 1, 2008, at 11:41 AM, thex@email.com wrote:

One other thing to look at is to ensure that your inputs to GetInventoryItem are correct. What do the docs say might cause the structure to be zero-filled?

There are no docs. All I got are the dll and some C# examples like this:

[DllImport("FFACE.dll", EntryPoint = "GetInventoryItem")] public static extern INVENTORYITEM InventoryItem(int index);

and the working statment:

INVENTORYITEM x = FFACE.Inventory.InventoryItem(1);

Thats about it. Next to that I got the fface.h file (which is outdated).

The C# and the JNA run against the same dll and the dll access a running application. I do let both run with the same running process of that application. I am using the same parameters in C# and JNA.

I tried even to change the JNA method to use a single parameter only aswell as the C# implementation does. The return value still was empty.

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.