JAVA NATIVE ACESS
843829Sep 9 2010 — edited Sep 9 2010HI,
I have a big problem with Java Native Access when call a function in dll file.
First, I have files xxx.dll,xxx.h (written by my partner) and document for functions.
Second, I am using JNA (java native access) to call the functions.
But, it has some functions that function's result is pass over memory of window.
In document description, it has tow constant: WM_USER = 0x0400, WM_USER_ENV = (WM_USER + 0)
I have just learn, so i don't know about that.
So, my problem is " i don't know how to get result of function that passed over to memory window )
This is my header file: MFSIOCTL.h
-----------------------------------------------------------------------------------------------------------------------------------------------
// Command
#define CMD_VERSION 'V'
#define CMD_SENSOR 'S'
#define CMD_FLICKER 'L'
#define CMD_GETSTATUS 'A'
#define DEST_1 '1' //front door / Card Reader Flicker Lamp
#define DEST_2 '2' //UPPER FRAME IN POSITION(CDM) / Printer Lamp
#define DEST_3 '3' //Receipt Exit Sensor / Cheque Lamp
#define DEST_4 '4' //Cheque Door Sensor / A4 or Cash Lamp
#define DEST_5 '5' //Bill Hopper Sensor - 2006/06/20 added
#define DEST_ALL '0' //Get all Status
//switch status or FLicker Lamp on/off
#define OPEN '0' //Flicker Off
#define CLOSE '1' //Flicker On
//added at 2004/09/17
#define WM_MFS_IO_OFFSET (WM_USER+0x900)
#define WM_MFS_IO_CHG_EVT (WM_MFS_IO_OFFSET + 0)
extern "C" __declspec(dllexport) BOOL __stdcall MFSIO_Open(HWND hWnd,BYTE comport);
extern "C" __declspec(dllexport) BOOL __stdcall MFSIO_Close(void);
extern "C" __declspec(dllexport) BOOL __stdcall MFSIO_GetVersion(LPSTR lpFWVer,LPSTR lpDLLVer);
extern "C" __declspec(dllexport) BOOL __stdcall MFSIO_LED(BYTE LEDNum,BYTE OnOff);
extern "C" __declspec(dllexport) BYTE __stdcall MFSIO_GetStatus(void);
-----------------------------------------------------------------------------------------------------------------------------------------------
And this is window message define:
--- Definition of Window Message
: Message is defined in MFSIOCTL.h as bellows.
#define WM_MFS_IO_OFFSET (WM_USER+0x900)
#define WM_MFS_IO_CHG_EVT (WM_MFSS_IO_OFFSET + 0)
MESSAGE WPARAM(Indicator ofDoor or Media) LPARAM(Status of Door or Media)
WM_MFSS_IO_CHG_EVT DEST_1 or OPEN or CLOSE
DEST_2 or
DEST_3 or
DEST_4
Refer to MFSIOCTL.h
-----------------------------------------------------------------------------------------------------------------------------------------------
In functions, i don't know that they relative with parameters as "WM_MSF_IO_OFFSET, WM_MFS_IO_CHG_EVT'' and parameters use for what?
How to get value of window message?
Please help me. Thank you.
Edited by: QuocTan on Sep 8, 2010 9:31 PM
Edited by: QuocTan on Sep 8, 2010 9:34 PM