1 message in net.java.dev.jna.users[jna-users] How to map this function
FromSent OnAttachments
Patrick LukatJul 9, 2008 5:10 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:[jna-users] How to map this functionActions...
From:Patrick Lukat (patr@web.de)
Date:Jul 9, 2008 5:10:25 am
List:net.java.dev.jna.users

Hello,

I have a single method I need to call from a DLL. I've looked at the
documentation and searched the mailing list and am still unsure how to map this
function.

// send a Master/Slave protocol // sendData = pointer to array of bytes or NULL // sendDataLen = amount of bytes you want to send // receiveData = pointer to receive buffer (array of bytes) // receiveDataLen = pointer to long for amount of received bytes

// If Result is TRUE you can read receiveDataLen bytes from receiveData

sendDataMasterToSlave(DWORD handle, DWORD targetAddr, DWORD primaryCmd, DWORD secondaryCmd, LPBYTE sendData, DWORD sendDataLen, LPBYTE receiveData, LPDWORD receiveDataLen);

I've tried the following two mappings without succes. I am especially unsure how
to map 'receiveData' respectively 'receiveDataLen' and how to get a byte[] of
the data transmitted. I have to admit that my knowledge of C is really poor.

boolean sendDataMasterToSlave(int handle, int targetAddr, int primaryCmd, int
secondaryCmd, LongByReference sendData, int sendDataLen, Pointer receiveData,
Pointer receiveDataLen);

boolean sendDataMasterToSlave(int handle, int targetAddr, int primaryCmd, int
secondaryCmd, LongByReference sendData, int sendDataLen, LongByReference
receiveData, IntByReference receiveDataLen);

Kind Regards

Patrick

_____________________________________________________________________ Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! http://smartsurfer.web.de/?mc=100071&distributionid=000000000066