7 messages in net.java.dev.jna.usersRe: [jna-users] Problem accessing Win...
FromSent OnAttachments
Michele CrociOct 29, 2007 8:05 am 
Timothy WallOct 29, 2007 11:54 am 
Michele CrociOct 30, 2007 4:08 am 
Timothy WallOct 30, 2007 6:50 am 
Michele CrociOct 30, 2007 8:50 am 
Michele CrociOct 31, 2007 10:05 am 
Michele CrociOct 31, 2007 10:15 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] Problem accessing Wintab32.dllActions...
From:Michele Croci (mcr@gmail.com)
Date:Oct 30, 2007 4:08:59 am
List:net.java.dev.jna.users

I'm sorry for disturbing you again but I'm still not able to get the correct data. Can you check if the method declarations in the Java-interface are correct?

Here the specification of (one part of) the dll:

HCTX WINAPI WTOpenA(HWND hWnd, LPLOGCONTEXTA lpLogCtx, BOOL fEnable)

BOOL WINAPI WTClose(HCTX hCtx)

UINT WINAPI WTInfoA(UINT wCategory, UINT nIndex, LPVOID lpOutput)

int WINAPI WTPacketsGet(HCTX hCtx, int cMaxPkts, LPVOID lpPkts)

Here (one part of) my Java-interface:

public interface Wintab32 extends W32API {

HDC WTOpenA(HWND hwnd, Logcontexta s, boolean b);

boolean WTClose(HDC hDC);

int WTInfoA(int category, int index, Logcontexta s);

int WTPacketsGet(HDC hdc, int max, Packet[] p);

}

}

WTOpenA, WTInfoA and WTClose seems to work correctly, but WTPacketsGet doesn't.

thx again,

Michele

2007/10/29, Timothy Wall <twal@dev.java.net >:

On Oct 29, 2007, at 11:05 AM, Michele Croci wrote:

I get alway ' 0 ' for x and y values. Maybe the problem is in the definition of my custom structures. Here the conversion I have made:

DWORD -> int UINT -> int LONG -> long BOOL -> int

Are they right?

LONG is 32 bits on windows, so you should use "int". You can use "boolean" for BOOL if you pass W32API.DEFAULT_OPTIONS as the options in your loadLibrary call.