FF DLL Project: Form doesn't seem to close

Started by Eros Olmi, December 29, 2014, 08:23:10 PM

Previous topic - Next topic

Eros Olmi

Hope someone can help me.

I have a simple FF DLL project that contains a simple Form called frmMAIN.
DLL creation is OK.

In order to be able to show that form from a calling executable, I've create the following "ShowMyForm" function:
Function ShowMyForm Alias "ShowMyForm" (ByVal hwnd As Dword, ByVal sPath As String) Export As Long
  MsgBox "before: " & sPath
  FRMMAIN_SHOW (hwnd, %TRUE)
  MsgBox "after"
End Function


ShowMyForm function gets 2 params, show a MSGBOX before and after showing the the form.

All is working fine except that when I close the form, MsgBox "after" is never executed and my application never gets back control.
Control of the application seems remaining inside FRMMAIN_SHOW function.

If I call   FRMMAIN_SHOW (hwnd, %FALSE) it is even worst: control of the application immediately return from FRMMAIN_SHOW to the calling exe and frmMain remains hanged on screen.

What is the correct way to show a form in a FF DLL project?

Thanks a lot
Eros

Elias Montoya

 First of, i would like to point out that firefly has a feature to make forms visible to external applications:



  Second, depending on what your form does, the execution point can get stuck . There are several ways to
get your form stucked, like invoking a sendcommand from a Timer function to another form... weird.

So, try the exportation thing. The declarations are easy to find in the generated firefly source code, and can be
invoked as easy as:

Call FRMMAIN_SHOW(hWnd, %TRUE)

From your calling executable.
Win7, iMac x64 Retina display 5K, i7-5820K 4.4 ghz, 32GB RAM, All updates applied. - Firefly 3.70.

Eros Olmi

Thanks a lot Elias, I didn't noticed that nice "Export" feature.

I'm using it right now, the form is showed correctly but the situation remain the same as before:

  • executing in MODAL way frmMain_Show(0, %TRUE, 0), when I close the form execution does not return to the calling EXE and application remain waiting something from the DLL
  • executing in NON MODAL way frmMain_Show(0, %FALSE, 0), execution pass immediately to the calling EXE and form remain blocked on screen.

It seems FF form procedure remain running in some way.

I just need a way to show the form in modal way and after the form is closed the execution returns to the calling EXE.

Ciao
Eros

Eros Olmi

UPDATE

Resolved the problem when calling not in MODAL way: frmMain_Show(0, %FALSE, 0)
I've added a message pump just after calling frmMain_Show(0, %FALSE, 0)

Still problems when calling in MODAL way: frmMain_Show(0, %TRUE, 0)
After I close the form, execution control does not return to calling exe.

Eros Olmi

UPDATE

Resolved also MODAL way: in MODAL way it seems you have to specify a parent window handle.
If parent is 0 then it seems execution remain inside the DLL instead of being passed to calling EXE