DLL-Funktion: Unsupported Argument

Shaddix

Neues Mitglied
Hallo zusammen,

ich habe ein Problem mit dem Aufruf einer DLL-Funktion aus einem Java-Programm heraus.
Laut Dokumentation erwartet die DLL für die Funktion BCSetTextA folgende Parameter:
- t_BarCode *pBarCode
- LPCSTR szText
- LONG nLen

Ich verwende JNA.


Mein Interface sieht wie folgt aus:
Java:
public interface tecitdll extends Library
{
	tecitdll INSTANCE = (tecitdll) Native.loadLibrary((Platform.isWindows() ? "TBarCode11_x64" : "c"), tecitdll.class);
        void BCLicenseMeA(String a, int b, int c, String d, int e);
        void BCSetTextA(tecitdll pointer, String text, int laenge);
       	void BCSetBCType(tecitdll pointer, String eBC_2OF5IL);
	void BCBitmapToFileA(tecitdll pointer, String pfad, Rectangle rechteck);
}


Die DLL habe ich so instanziert:
Java:
tecitdll barcode = tecitdll.INSTANCE;


und diesen Barcode übergebe ich als ersten Parameter:
Java:
barcode.BCSetTextA(barcode, strBarcode, strBarcode.length());


Der Aufruf beschert mir dann diese Fehlermeldung:
Code:
Unsupported argument type com.sun.proxy.$Proxy0 at parameter 0 of function BCSetTextA


Die Dokumentation zur DLL findet ihr hier:
TEC-IT TBarCode Library 11: Barcode Data


Ich hoffe auf baldige Hilfe

Vielen Dank im Voraus
 
So wirklich kenne ich mich mit JNI nicht aus. Dort müsste doch eigentlich das "native" Schlüsselwort stehen?

Java:
public interface tecitdll extends Library
{
    tecitdll INSTANCE = (tecitdll) Native.loadLibrary((Platform.isWindows() ? "TBarCode11_x64" : "c"), tecitdll.class);
    native void BCLicenseMeA(String a, int b, int c, String d, int e);
    native void BCSetTextA(tecitdll pointer, String text, int laenge);
    native void BCSetBCType(tecitdll pointer, String eBC_2OF5IL);
    native void BCBitmapToFileA(tecitdll pointer, String pfad, Rectangle rechteck);
 }
 

Neue Themen


Zurück
Oben