Debugging JNI with MSVC++6 - Showing a GUI
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Stephanie_Legault
Posted On:   Monday, March 25, 2002 08:26 AM

I've followed the instructions on how to use MSVC++'s "debug" tab to call java.exe. I can debug my application, up until my Java code attempts to use GUI components (specifically Swing components.) Here are some code snippets to help: // Myclass.java public class MyClass { static { System.loadLibrary("MyDLL"); } private native void InitializeDLL(); public void main(String args[]) { // Native call InitializeDLL(); // Create a GUI for this app JFrame f = new JFrame("My App"); // ... } } Breakpoints in the InitializeDLL() function work correctly    More>>

I've followed the instructions on how to use MSVC++'s "debug" tab to call java.exe. I can debug my application, up until my Java code attempts to use GUI components (specifically Swing components.) Here are some code snippets to help:


			
// Myclass.java
public class MyClass
{
static {
System.loadLibrary("MyDLL");
}

private native void InitializeDLL();

public void main(String args[]) {
// Native call
InitializeDLL();

// Create a GUI for this app
JFrame f = new JFrame("My App");
// ...
}
}


Breakpoints in the InitializeDLL() function work correctly in MSVC++6. However, after exiting the InitializeDLL() function, the debugger goes into dissasembly code, breaking on the following instruction


0D32258E   jmp         0D3225DB


For some reason, the debugger cannot go beyond this instruction and execution/debugging stops. If I remove GUI code from the Java app, then all seems fine. I am baffled, and somewhat frustrated at this setback. The GUI is essential to my application, I can't remove it. And I really need to test further than just the Initialize() functionality. Any help would be greatly appreciated. Thanks.

   <<Less
About | Sitemap | Contact