22 messages in net.java.dev.jna.usersRe: [jna-users] Structure by value an...
FromSent OnAttachments
Edroaldo Lummertz da RochaNov 7, 2008 3:21 pm 
Timothy WallNov 7, 2008 4:44 pm 
Edroaldo Lummertz da RochaNov 10, 2008 6:07 am 
Timothy WallNov 10, 2008 6:34 am 
Edroaldo Lummertz da RochaNov 10, 2008 6:59 am 
Timothy WallNov 10, 2008 7:57 am 
Edroaldo Lummertz da RochaNov 10, 2008 8:38 am 
Timothy WallNov 10, 2008 10:40 am 
Edroaldo Lummertz da RochaNov 10, 2008 12:17 pm 
Timothy WallNov 10, 2008 1:46 pm 
Edroaldo Lummertz da RochaNov 10, 2008 1:57 pm 
Timothy WallNov 10, 2008 6:27 pm 
Edroaldo Lummertz da RochaNov 11, 2008 3:25 am 
Edroaldo Lummertz da RochaNov 11, 2008 3:40 am 
Edroaldo Lummertz da RochaNov 12, 2008 6:42 am 
Edroaldo Lummertz da RochaNov 14, 2008 3:46 am 
Timothy WallNov 14, 2008 4:37 am 
Edroaldo Lummertz da RochaNov 14, 2008 9:41 am 
Edroaldo Lummertz da RochaNov 14, 2008 10:05 am 
Timothy WallNov 14, 2008 11:31 am 
Edroaldo Lummertz da RochaNov 17, 2008 4:35 am 
Timothy WallNov 17, 2008 5:17 am 
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] Structure by value and referenceActions...
From:Timothy Wall (twal@dev.java.net)
Date:Nov 10, 2008 10:40:55 am
List:net.java.dev.jna.users

The mappings appear to be correct. Does the example work in C? If so, at what point does the JAva vs C behavior differ? At what point do you see differing values for data?

On Nov 10, 2008, at 11:39 AM, Edroaldo Lummertz da Rocha wrote:

I have already changed it. I do not have the type long in my code, just NativeLong, but it does not work. My Structure class is correct? My pointers are correct? Is it possible to use JNA with any DLL? Thank so much!!!

2008/11/10 Timothy Wall <twal@dev.java.net>

On Nov 10, 2008, at 10:00 AM, Edroaldo Lummertz da Rocha wrote:

Where the bold text is the functions of DLL that I need. I am going

to post the signatures of java functions and the C++ function, for comparasion. I cannot see the errors, the type mapping is correct? I do not get compiler errors and do not get execution error, just does not work.

C signatures

int Initialize_HL(PCHAR BoardID,void ** hDev); int K_Move_Data_HL(void ** hDev,BOOL RW,unsigned short Nb_Words, unsigned short * Buffer,signed long DSPAddress, int MemSpace,char * Symbol,struct HSymTbl SymTable);

LoadUser_HL(void ** hDev,char * FilePath,struct HSymTbl * pSymTable);

Java Assignatures:

public interface SignalRangerInterface extends Library { public int Initialize_HL(String boardId, PointerByReference hDev); public int LoadUser_HL(PointerByReference hDev, String filePath, SignalRanger.HSymTbl pSymTable); public int K_Move_Data_HL(PointerByReference hDev, int rw, short nbWords, short[] buffer, long dSPAdrress, int memSpace, String symbol, SignalRanger.HSymTbl.ByValue symTable);

Change long to NativeLong for DSPAddress.

public int ExecUser_HL(PointerByReference hDev, long dSPAddress, String symbol, SignalRanger.HSymTbl.ByValue pSymTable);

Ditto here.