cast probleme
-
Hallo
Hallo Ich bekomme folgende Fehlermeldung
char *(const char *,const char *,const char *,const char *)' : cannot convert parameter 4 from 'class _jstring *' to 'const char *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast_cast,wie caste ich einen jstring in einen char?
JNIEXPORT jstring JNICALL Java_ch_Test (JNIEnv *, jclass, jstring tName, jstring tPath, jstring tLog, jstring tDebug) { jstring lresult = test(tName,tPath, tName, tDebug); return lresult; }
-
gib mal die klassendeklaration von jstring an
-
Hallo
Die klassendeklaration ist jstring. und das Problem ist eben, dass ich ein jstring* in ein const char* konvertieren muss
-
jaque schrieb:
Hallo
Die klassendeklaration ist jstring. und das Problem ist eben, dass ich ein jstring* in ein const char* konvertieren muss
tolle antwort.
es gibt bestimmt eine funktion in der jstring klasse, die dir den string als char * oder zumindest als const char * zurück gibt.ich kenn die klasse jedoch nicht, wodurch ich mir kein bild machen kann.
ich meinte natürlich die .h datei von jstring
oder finde ich eine doku zur klasse im web oder so?
-
jaque schrieb:
Hallo
Die klassendeklaration ist jstring. und das Problem ist eben, dass ich ein jstring* in ein const char* konvertieren muss
jstring ist ein Typ und hat eine Klassendeklaration. esskar wollte die Klassendeklaration haben und nicht den Namen des Typs.
Funktionen zur Konvertierung solltest du in der JNI Dokumentation finden können.