jni and non modal dialog problem

I have a win32 dll library with two function that calling dialog window, modal and non modal.
From java with jni I load jni wrapper dll, that load my dll and call this functions.
When call modal dialog his showing Ok, but when call non modal dialog his showin but freez, java window is showing ok.
From c program that loading jni wrapper and call non modal dialog is ok.
In java methods described as static native.

Comments

  • : I have a win32 dll library with two function that calling dialog
    : window, modal and non modal.
    : From java with jni I load jni wrapper dll, that load my dll and call
    : this functions.
    : When call modal dialog his showing Ok, but when call non modal
    : dialog his showin but freez, java window is showing ok.
    : From c program that loading jni wrapper and call non modal dialog is
    : ok.
    : In java methods described as static native.

    A non-modal dialog depends on the caller for it's windows messages. Since the JNI doesn't provide that ability as a standard option, you as a programmer must regularly catch the windows messages and forward them from your Java code to the non-modal dialog.
    Since C programs run natively on windows, they hook correctly into the windows messaging subsystem as standard, and forward all messages intended for the non-model dialog.
    The only two options I can see are:
    - write additional code in the dll and the Java program to handle the windows messages intended for the non-modal dialog
    - rewrite the non-modal dialog as a Java dialog.
  • thanks for answer

    : A non-modal dialog depends on the caller for it's windows messages.
    : Since the JNI doesn't provide that ability as a standard option, you
    : as a programmer must regularly catch the windows messages and
    : forward them from your Java code to the non-modal dialog.
    : Since C programs run natively on windows, they hook correctly into
    : the windows messaging subsystem as standard, and forward all
    : messages intended for the non-model dialog.
    : The only two options I can see are:
    : - write additional code in the dll and the Java program to handle
    : the windows messages intended for the non-modal dialog
    : - rewrite the non-modal dialog as a Java dialog.
  • : I have a win32 dll library with two function that calling dialog
    : window, modal and non modal.
    : From java with jni I load jni wrapper dll, that load my dll and call
    : this functions.
    : When call modal dialog his showing Ok, but when call non modal
    : dialog his showin but freez, java window is showing ok.
    : From c program that loading jni wrapper and call non modal dialog is
    : ok.
    : In java methods described as static native.

    Hello,
    I have the same problem but when I want to display the modal dialog(dlg.DoModal()), win32 dll is crashed.Why?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories