I think I've found what I was looking for.
public void callback(Pointer pContext, Pointer pPeaks, int dwChannels, long
llTimestamp) {
int [] peaks = pPeaks.getIntArray(0, dwChannels);
...
}
I no-longer get errors.. but my callback doesn't seem to get called either...
That's appears to be an entirely different issue though :-)
Scott
-----Original Message-----
From: Scott Palmer [mailto:Scot...@2connected.org]
Sent: April 7, 2008 11:27 AM
To: use...@jna.dev.java.net
Subject: [jna-users] Help with:Callback argument class [I requires custom type
conversion
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,