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:thex...@email.com (thex@email.com)
Date:Nov 1, 2008 8:40:55 am
List:net.java.dev.jna.users

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.

A PointerByReference is equivalent to "void **", not "void *". The latter mapping is the correct one, although you should probably be sure that your IntByReference is initialized to the size of your buffer to avoid overflow.

Thanks for explaining. I ran into the effect, that when I call GetInventoryItem
before that JNA method with the PointerByReference parameter the access violation gets not
triggered.

Something must be wrong with GetInventoryItem, indeed. No other method could
trigger the access violation (but none other is returning a struct anyway).

Regards, Armin