Авторизация  
mmogo

supported and are written using the maddenvip

Рекомендуемые сообщения

mmogo    0

An integer, so we write that as "I".Custom types are also supported and are written using the fully-qualified name, a prefix of "L", and a suffix of ";". For example, a signature of Madden NFL 18 Coins "(Ljava/util/ArrayList;)Z" describes a function that takes a java.util.ArrayList instance and returns a boolean (which is what the "Z" stands for).In C/C++, the jobject data type is used for non-primitive types. Let's assume we already have the method handle plus a jobject named "testClassInstance". Now,

 

call the ComputeMult function:jfloat a = 4.0f;jfloat b = 0.5f;jint result = env->CallIntMethod(testClassInstance, computeMultHandle, a, b);The "result" integer variable should now hold a value of 2.Creating An Instance Of A Java Class In C/C++In the previous section we called a function on Cheap NFL 18 Coins an existing Java object. But what if we want to create our own instance? Let's create a TestClass object:jclass testClassHandle = env->FindClass("com/adbad/jnitest/TestClass");

 

testClassCtor = env->GetMethodID(testClassHandle, "", "()V");jobject testClassInstance = env->NewObject(arrayListClass, arrayListCtor);As you can see, getting a handle to the constructor is the same as getting any other member function. The only difference is that "" is used as the function name. To create the instance, we use the JNIEnv's "NewObject" method and pass in the class and constructor handles.Helpful Linkshttp:www.cygwinhttp:answers.yahoo/question/index?

 

qid=20080326074018AAarBJ9http:java.sun/docs/books/jni/html/types.htmlhttp:en.wikipedia.org/wiki/Java_Native_Interfacehttp:java.sun/docs/books/jni/html/fldmeth.htmlhttp:journals.ecs.soton.ac.uk/java/tutorial/native1.1/implementing/method.html[This piece was reprinted from AltDevBlogADay, a shared blog initiative started by mike_acton devoted to giving game developers of all disciplines a place to maddenvip  motivate each other to write regularly about their personal game development passions.

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Гость
Эта тема закрыта для публикации ответов.
Авторизация