3 messages in net.java.dev.jna.usersHelp with:Callback argument class [I ...
FromSent OnAttachments
Scott PalmerApr 7, 2008 8:26 am 
Scott PalmerApr 7, 2008 10:12 am 
Timothy WallApr 7, 2008 10:21 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:Help with:Callback argument class [I requires custom type conversionActions...
From:Scott Palmer (Scot@2connected.org)
Date:Apr 7, 2008 8:26:58 am
List:net.java.dev.jna.users

I'm getting :

java.lang.IllegalArgumentException: Callback argument class [I requires custom type conversion

Here is the C code:

typedef void (__cdecl* KMEXT_FPMONITORINGVUMETER)( void *pContext, ULONG *pPeaks, DWORD dwChannels, LONGLONG llTimestamp );

Here is my Java declaration of the callback:

public static interface KMEXT_FPMONITORINGVUMETER extends Callback { void callback(Pointer pContext, int [] pPeaks, int dwChannels, long llTimestamp); }

The dwChannels parameter tells me the number of 32-bit ints to expect starting at the address in pPeaks. I could also use a Buffer type instead of an int array, I suppose.. but I think I will still have the problem of dealing with the size of the buffer.

What is the best practice in this situation?

Thanks in advance,

Scott