I've set up a Java project that makes JNI calls to a C++ DLL that uses MFC. Things work fine unless I do something in the C++ code that creates a new thread of execution: when I make a call to "spawn()" it works (i.e., the spawned proc executes), but the JVM crashes on returning from the call; when I create a CAsynchSocket object on the C++ heap with "new," the JVM hangs; when I call "AfxBeginThread()" it also hangs the JVM.
Is it possible to have a socket listening in the C++ code beyond the scope of a single JNI call? That is the real programming requirement: to have the socket active on the C++ side in between JNI calls.
Start Free Trial