|
首頁 | 討論區 | 最新話題 | 搜尋 | XML | 登入 |
Blueimp » 列出所有討論區 » 討論區: Java Tech | |
|
此話題中所有文章數: 1 [ 話題狀態: 一般 ] | |
|
Registry a java callback method to any C++ task-thread這篇是我們討論要讓 C++ 呼叫 Java 執行結果的可能性時,C 同事提供的資料,尚未 study 且 J 同事還沒實作出來並與 K 同事的 C++ 語言整合。http://mqjing.blogspot.com/2008/01/java-c-callback-java-method.html Registry a java callback method to any C++ task-thread ... Sometimes, in java application, we will launch a C++ working thread to do a high computing consuming job. When the job done, send a notification to the java application. You can use a Message to finish the requirement.Also, you can use JNI to invoke any method of a java object that are referenced from the parameter jobject. If you invoke the Java method in other thread in C++, you will face a problem! The JNI interface pointer (JNIEnv) is valid only in the current thread.If you want to access java object at other thread, you should use AttachCurrentThread to attach current thread to the java virtual machine. How to use AttachCurrentThread in your code? An example is listed as following.
其他程式
---------------------------------------- 支持小惡魔 BTC : 19tn3RnCuwZVukXAwyhDWZD4uBgUZoGJPx LTC : LTFa17pSvvoe3aU5jbmfcmEpo1xuGa9XeA 知識跟八卦一樣,越多人知道越有價值;知識最好的備份方法,散播! 藍色小惡魔(林永傑): 臉書 ---------------------------------------- [編輯文章 2 次, 最後修改: jieh 於 2011/8/24 下午 02:14:38] |
|||
|