Bonjour à tous et à toutes...

Après bien des péripéties en JNA, me voilà bloqué depuis plusieurs heures sur ce problème : comment écrire dans l'interface un char** et comment l'appler en Java.
Exemple de code C :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
typedef struct _HwdFileRec*	 	HwdFile ;
typedef char*				HwdError;
typedef struct _HwdFormatVersionRec*	HwdFormatVersion;
typedef struct _HwdFileClassRec*	HwdFileClass;
 
 
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
 
extern HwdFile HwdFileCreateWithError( HwdFormatVersion aFormatVersion,HwdFileClass aFileClass,HwdError* anError);
extern HwdFile HwdFileCreateWithError2( HwdFormatVersion aFormatVersion,HwdFileClass aFileClass,HwdError anError);
 
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
Voilà ce que JNAerator me pond :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package hwdhdr;
import com.sun.jna.Library;
import com.sun.jna.Native;
import com.sun.jna.NativeLibrary;
import com.sun.jna.Pointer;
import com.sun.jna.PointerType;
/**
 * JNA Wrapper for library <b>HwdHdr</b><br>
 * This file was autogenerated by <a href="http://jnaerator.googlecode.com/">JNAerator</a>,<br>
 * a tool written by <a href="http://ochafik.com/">Olivier Chafik</a> that <a href="http://code.google.com/p/jnaerator/wiki/CreditsAndLicense">uses a few opensource projects.</a>.<br>
 * For help, please visit <a href="http://nativelibs4java.googlecode.com/">NativeLibs4Java</a> , <a href="http://rococoa.dev.java.net/">Rococoa</a>, or <a href="http://jna.dev.java.net/">JNA</a>.
 */
public interface HwdHdrLibrary extends Library {
	public static final String JNA_LIBRARY_NAME = "HwdHdr";
	public static final NativeLibrary JNA_NATIVE_LIB = NativeLibrary.getInstance(HwdHdrLibrary.JNA_LIBRARY_NAME);
	public static final HwdHdrLibrary INSTANCE = (HwdHdrLibrary)Native.loadLibrary(HwdHdrLibrary.JNA_LIBRARY_NAME, HwdHdrLibrary.class);
	/**
         * Original signature : <code>HwdFile HwdFileCreateWithError(HwdFormatVersion, HwdFileClass, HwdError*)</code><br>
         * <i>native declaration : line 18</i>
         */
	HwdHdrLibrary.HwdFile HwdFileCreateWithError(HwdHdrLibrary.HwdFormatVersion aFormatVersion, HwdHdrLibrary.HwdFileClass aFileClass, Pointer anError);
	/**
         * Original signature : <code>HwdFile HwdFileCreateWithError2(HwdFormatVersion, HwdFileClass, HwdError)</code><br>
         * <i>native declaration : line 19</i><br>
         * @deprecated use the safer methods {@link #HwdFileCreateWithError2(hwdhdr.HwdHdrLibrary.HwdFormatVersion, hwdhdr.HwdHdrLibrary.HwdFileClass, java.lang.String)} and {@link #HwdFileCreateWithError2(hwdhdr.HwdHdrLibrary.HwdFormatVersion, hwdhdr.HwdHdrLibrary.HwdFileClass, com.sun.jna.Pointer)} instead
         */
	@Deprecated 
	HwdHdrLibrary.HwdFile HwdFileCreateWithError2(HwdHdrLibrary.HwdFormatVersion aFormatVersion, HwdHdrLibrary.HwdFileClass aFileClass, Pointer anError);
	/**
         * Original signature : <code>HwdFile HwdFileCreateWithError2(HwdFormatVersion, HwdFileClass, HwdError)</code><br>
         * <i>native declaration : line 19</i>
         */
	HwdHdrLibrary.HwdFile HwdFileCreateWithError2(HwdHdrLibrary.HwdFormatVersion aFormatVersion, HwdHdrLibrary.HwdFileClass aFileClass, String anError);
	public static class HwdFileClass extends PointerType {
		public HwdFileClass(Pointer address) {
			super(address);
		}
		public HwdFileClass() {
			super();
		}
	};
	public static class HwdFormatVersion extends PointerType {
		public HwdFormatVersion(Pointer address) {
			super(address);
		}
		public HwdFormatVersion() {
			super();
		}
	};
	public static class HwdFile extends PointerType {
		public HwdFile(Pointer address) {
			super(address);
		}
		public HwdFile() {
			super();
		}
	};
}
Mais je n'arrive pas à appeler ce code, ça crash la JVM lorsque je l'appel comme ça :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
			HwdError errorFile = new HwdError();
			Pointer errorPointer = errorFile.getPointer();
			HwdFile fileTHF = kernelhdr.HwdFileCreateWithError(formatVersionTHF,fileClassTHF,errorPointer);
Comme lors de mon précédent message, je pense que c'est tout à fait possible mais la syntaxe n'est pas super simple....
Si vous avez une idée ?