locked
Release a VFP Exe & Release in Form RRS feed

  • Question

  • Hello All,

    I have build my VFP9 (SP2) Application into several EXE's (Module Wise).

    The Main EXE is the Application Platform, which Evokes other Exe's .

    So for Example, if Main.Exe, Makes a Call to  Books.Exe, It functions Normally and I achieve what I want to do. Once the Books.Exe is closed (by Releasing the Interface form), I notice that it still appears in the Task Bar.

    Why Do I require this?

    Sometimes, I make Changes on the fly and want to erase these I cannot because some user although not currently working on the particular interface, is still holding it because of a previous Evoke"

     

    Secondly, How do I Call a form "Form B" from "Form A" and Release "Form A" after the call without putting a check on Form B using WExists().

     

    Thanks

     

    Stan


     


    Monday, June 27, 2011 7:22 PM

Answers

  • Regarding the EXE part of your question: As long as you don't tell how you evoke the other modules there's no telling why they are keept in the task bar. Closing a form deos not close a EXE, for example if an READ EVENTS still runs.

    On the other problem: You simply DO FORM formB in form A and directly afterwards thisform.release(). This would only not cause formA to release, if fom b is modal, as execution then would not continue to the release unless form b finishes.

    If form B is modal though, and you want form A to finish directly after starting the modal form B, not wanting to wait for form B would be a design flaw, wouldn't it? Why would you start a modal form, which is meant as a dialog the user MUST reply to immediatley before using any other form? Why would you start such a dialog and then not wait for its result and react to that? Are you using modal just to keep the form running? Then you're misusing that windowtype.

    Bye, Olaf.

    • Proposed as answer by Mike Feng Wednesday, June 29, 2011 7:38 AM
    • Marked as answer by Mike Feng Wednesday, July 6, 2011 11:26 AM
    Monday, June 27, 2011 8:45 PM

All replies

  • Usually release form is enought to close form...

    You may use DO FORM_B from Form A. Yoyu may try from Form B, FORM_A.Release

     


    dni
    Monday, June 27, 2011 7:56 PM
  • Regarding the EXE part of your question: As long as you don't tell how you evoke the other modules there's no telling why they are keept in the task bar. Closing a form deos not close a EXE, for example if an READ EVENTS still runs.

    On the other problem: You simply DO FORM formB in form A and directly afterwards thisform.release(). This would only not cause formA to release, if fom b is modal, as execution then would not continue to the release unless form b finishes.

    If form B is modal though, and you want form A to finish directly after starting the modal form B, not wanting to wait for form B would be a design flaw, wouldn't it? Why would you start a modal form, which is meant as a dialog the user MUST reply to immediatley before using any other form? Why would you start such a dialog and then not wait for its result and react to that? Are you using modal just to keep the form running? Then you're misusing that windowtype.

    Bye, Olaf.

    • Proposed as answer by Mike Feng Wednesday, June 29, 2011 7:38 AM
    • Marked as answer by Mike Feng Wednesday, July 6, 2011 11:26 AM
    Monday, June 27, 2011 8:45 PM
  • Olaf,

    I guess you are so right. Form B is not Modal hence form A does not have to wait. I will try the Thisform.Release in Form A immediately after

    I call the Non-Modal Form B.

     

    About the EXE.

    A.Exe is a vfp Exe and has its Read Events.  B.Exe is also a vfp Exe and has its own read events. 

     

    The Call from A.Exe (Command Button) is  is something like this   

     

    IF WEXIST("BFORM")   &&The Name for Main Interface Form of the "B.EXE"  is "BFORM" (This is done so that if exists it brings it up rather than load B.Exe again)

        ZOOM window BFORM Normal

     ELSE

        =ExeLoad("BExe","")  && I do this here because I dont want Exe A to Compile Exe B when creating Executable "A".  Hence Exe B is like a reference Parameter

     

       Endif 

    ************************************************

    Function ExeLoad(ThisExe,cThisParmString)

    ThisExe=IIF(OCCURS(".",ThisExe)=0,Alltrim(ThisExe)+'.Exe',ThisExe)   &&Just to make sure of the extention

    if .Not. File(ThisExe)

        =MessageBox('Attach Module Call Returns Null...Module Loader Not Found!',16,'Missing Executable '+ThisExe)

      Return

     Endif

    cThisParmString=IIF(EMPTY(cThisParmString),"",ALLTRIM(cThisParmString))

    IF .Not. EMPTY(cThisParmString)

      ThisExe=ThisExe+" With "+cThisParmString

     Endif   

    SET TALK OFF

    Do &ThisExe 

     

    Thanks & Regards

     


    Monday, June 27, 2011 11:11 PM