2 messages in net.java.dev.jna.usersRe: [jna-users] Question on mapping
FromSent OnAttachments
Gabriel RossettiNov 13, 2007 5:57 am 
Timothy WallNov 13, 2007 12:51 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] Question on mappingActions...
From:Timothy Wall (twal@dev.java.net)
Date:Nov 13, 2007 12:51:50 pm
List:net.java.dev.jna.users

Canonically, PVOID is com.sun.jna.Pointer.

IntByReference iref = new IntByReference(); SystemParametersInfo(SPI_GETSCREENSAVERRUNNING, 0, iref.getPointer(), 0); boolean running = iref.getValue() != 0;

On Nov 13, 2007, at 8:58 AM, Gabriel Rossetti wrote:

Hello,

I am trying to map this :

http://msdn2.microsoft.com/en-us/library/ms724947.aspx

BOOL WINAPI SystemParametersInfo( __in UINT uiAction, __in UINT uiParam, __inout PVOID pvParam, __in UINT fWinIni ); and I'm having some problems. I get an exception and it's a bit hard to know what param is wrong. I tried to do this :

public boolean SystemParametersInfo(int uiAction, int uiParam, boolean pvParam, int fWinIni);

and this

ublic boolean SystemParametersInfo(int uiAction, int uiParam, PointerType pvParam, int fWinIni);

but neither work. I call the Mapped function like so (the boolean version):

... boolean running = false; User32.INSTANCE.SystemParametersInfo(SPI_GETSCREENSAVERRUNNING, 0, running, 0); return running != false;

Could someone please help? I couldn't find out how to map the PVOID (*void?), but it may be another thing.