Hi,
i have a Callback problem and need some concepts to solve this.
In my C++ MFC Windows Applikation i create a JVM. From C++ i call a
method that starts a java process (Sending several server request's).
This process has several states i want to know in my C++ App. The
Problem is, how do i get back that Information into my C++ App ?
I know it is possible to Run a Java App an Call functions of a C++ DLL.
I also know how to Create a C++ app, Invoke a JVM an Call some java
Functions. But is it possible to Create a C++ App, Invoke the JVM, an
get access to my C++ Application Handle to call some C++ functions ?
Now i've done some tricky stuff in writing my Java Response (int from 0
to 5) to a File an Frequently Read this File from C++ to see if
something changed. Thats ..... ugly.
Another Way i have not try'ed yet is to save that value in a Java Class
and Frequently Call a getResponseCode() from C++ to get that value. I
realy dont like this BruteForce Style of getting that Value !
Any Ideas ?
best Regards,
Dave
Summary:
C++(exe) calls Java(jvm.dll) Function
Java(jvm.dll) Calls back C++(exe). // How to ?
Gordon Beaton - 30 Aug 2006 14:16 GMT
> Summary:
>
> C++(exe) calls Java(jvm.dll) Function
>
> Java(jvm.dll) Calls back C++(exe). // How to ?
Declare one or more native methods in an appropriate Java class.
Implement those methods in the C++ exe. Use RegisterNatives() to
associate them with their class. Invoke them from the Java application
like any other methods.
/gordon

Signature
[ don't email me support questions or followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
davidb - 30 Aug 2006 14:47 GMT
Thank you, thats what i was looking for !
Gordon Beaton schrieb:
> > Summary:
> >
[quoted text clipped - 12 lines]
> [ don't email me support questions or followups ]
> g o r d o n + n e w s @ b a l d e r 1 3 . s e