Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 25 JAN 2022 06:05:00PM Barry Stevens wrote:

I have an application that starts as a mdi form, but is not visible as it firsts displays a dialogbox for user login.

When the the cancel button is pressed and returns from the dialog with no values, it then closes the mdi and does:


Void = send_Event(MDI_Frame@, "CLOSE" )

call set_property_only("SYSTEM","SHUTDOWN",1)

// Close the application

Call Exec_Method( "SYSTEM", "DESTROY", "SYSTEM" )

the application closes, but the revengine is still open.

How can I CLOSE the revengine programmatically so that it no longer running (openinsight.exe in the task manager)


At 26 JAN 2022 05:49AM Carl Pates wrote:

Hi Barry,

The PS will shut the system down when it detects that there are no more running OI forms - RevEngine isn't an OI form so this doesn't enter into that calculation, so there's something else in play.

If your MDI Form is indeed closed then you shouldn't need any more calls to shut down the system - it should already in process, so the first thing to check is if there are any more hidden forms running? The only thing that will stop the auto-destroy is the SUPPRESSAUTODESTROY property - are you setting that anywhere in your app?

Next point - setting the SHUTDOWN property and calling the DESTROY method are doing the same thing - you don't need both - perhaps that might cause a conflict, though I couldn't think why off the top of my head.

Carl Pates


At 26 JAN 2022 04:49PM Barry Stevens wrote:

Hi Barry,

The PS will shut the system down when it detects that there are no more running OI forms - RevEngine isn't an OI form so this doesn't enter into that calculation, so there's something else in play.

If your MDI Form is indeed closed then you shouldn't need any more calls to shut down the system - it should already in process, so the first thing to check is if there are any more hidden forms running? The only thing that will stop the auto-destroy is the SUPPRESSAUTODESTROY property - are you setting that anywhere in your app?

Next point - setting the SHUTDOWN property and calling the DESTROY method are doing the same thing - you don't need both - perhaps that might cause a conflict, though I couldn't think why off the top of my head.

Carl Pates

SUPPRESSAUTODESTROY - is being set, that was going to be my next observation alert for you.


At 26 JAN 2022 05:22PM Barry Stevens wrote:

Hi Barry,

The PS will shut the system down when it detects that there are no more running OI forms - RevEngine isn't an OI form so this doesn't enter into that calculation, so there's something else in play.

If your MDI Form is indeed closed then you shouldn't need any more calls to shut down the system - it should already in process, so the first thing to check is if there are any more hidden forms running? The only thing that will stop the auto-destroy is the SUPPRESSAUTODESTROY property - are you setting that anywhere in your app?

Next point - setting the SHUTDOWN property and calling the DESTROY method are doing the same thing - you don't need both - perhaps that might cause a conflict, though I couldn't think why off the top of my head.

Carl Pates

SUPPRESSAUTODESTROY - is being set, that was going to be my next observation alert for you.

Also, where can I see what what forms are running. Debug show VSPRINTER2 as the only 'FORM' properties, started to help with report init speed.

Added a set_printer("TERM") but still shows in debug (I am probably down the wrong rabbit hole here).

My suspicion has always been the SUPPRESSAUTODESTROY (Just though now I could try setting to 0)


At 26 JAN 2022 05:26PM Barry Stevens wrote:

Hi Barry,

The PS will shut the system down when it detects that there are no more running OI forms - RevEngine isn't an OI form so this doesn't enter into that calculation, so there's something else in play.

If your MDI Form is indeed closed then you shouldn't need any more calls to shut down the system - it should already in process, so the first thing to check is if there are any more hidden forms running? The only thing that will stop the auto-destroy is the SUPPRESSAUTODESTROY property - are you setting that anywhere in your app?

Next point - setting the SHUTDOWN property and calling the DESTROY method are doing the same thing - you don't need both - perhaps that might cause a conflict, though I couldn't think why off the top of my head.

Carl Pates

Call Set_Property_only( "SYSTEM", "SUPPRESSAUTODESTROY", TRUE$ )

SUPPRESSAUTODESTROY - is being set, that was going to be my next observation alert for you.

Also, where can I see what what forms are running. Debug show VSPRINTER2 as the only 'FORM' properties, started to help with report init speed.

Added a set_printer("TERM") but still shows in debug (I am probably down the wrong rabbit hole here).

My suspicion has always been the SUPPRESSAUTODESTROY (Just though now I could try setting to 0)

YEP!!

Call Set_Property_only( "SYSTEM", "SUPPRESSAUTODESTROY", false$ )

fixed the issue


At 26 JAN 2022 05:50PM Carl Pates wrote:

Use SUPPRESSAUTODESTROY with care - it's only meant to be used in very limited and specific circumstances

You can get a list of running forms easily via the system monitor using the "LO" (List Objects) command:

lo "" window

Will do it.

These commands are documented in the "Introduction" doc on the RevDevX blog.

Carl Pates


At 26 JAN 2022 06:10PM Barry Stevens wrote:

Hi Barry,

The PS will shut the system down when it detects that there are no more running OI forms - RevEngine isn't an OI form so this doesn't enter into that calculation, so there's something else in play.

If your MDI Form is indeed closed then you shouldn't need any more calls to shut down the system - it should already in process, so the first thing to check is if there are any more hidden forms running? The only thing that will stop the auto-destroy is the SUPPRESSAUTODESTROY property - are you setting that anywhere in your app?

Next point - setting the SHUTDOWN property and calling the DESTROY method are doing the same thing - you don't need both - perhaps that might cause a conflict, though I couldn't think why off the top of my head.

Carl Pates

Call Set_Property_only( "SYSTEM", "SUPPRESSAUTODESTROY", TRUE$ )

SUPPRESSAUTODESTROY - is being set, that was going to be my next observation alert for you.

Also, where can I see what what forms are running. Debug show VSPRINTER2 as the only 'FORM' properties, started to help with report init speed.

Added a set_printer("TERM") but still shows in debug (I am probably down the wrong rabbit hole here).

My suspicion has always been the SUPPRESSAUTODESTROY (Just though now I could try setting to 0)

YEP!!

Call Set_Property_only( "SYSTEM", "SUPPRESSAUTODESTROY", false$ )

fixed the issue

Whoops, spoke too soon.

This works if I run oi with dv=1 and the tools→launch application.

But id run with dv=0 (run application) it comes up with error msg:

<appname> initialisation

PSSI.01: No visible entry window started for the <appname> application. Process aborted

*

then application close but revengine still running.

Trimmed down to this:

                     Call Set_Property_only( "SYSTEM", "SUPPRESSAUTODESTROY", false$ )

* Void = send_Event(MDI_Frame@, "CLOSE")

* Call Exec_Method( "SYSTEM", "DESTROY", "SYSTEM" )

This is the sledgehammer commands I also tried:

                    Call Set_Property_only( "SYSTEM", "SUPPRESSAUTODESTROY", false$ )
		foo  = set_printer("TERM",2)
		call set_property_only(MDI_Frame@, "VISIBLE",1)
		Void = send_Event(MDI_Frame@, "CLOSE")
		Void = Send_Event(@Window, "CLOSE")
		// Close the application
	       Call Exec_Method( "SYSTEM", "DESTROY", "SYSTEM" )

Obviously there is something else at play here.


At 26 JAN 2022 06:21PM Barry Stevens wrote:

Hi Barry,

The PS will shut the system down when it detects that there are no more running OI forms - RevEngine isn't an OI form so this doesn't enter into that calculation, so there's something else in play.

If your MDI Form is indeed closed then you shouldn't need any more calls to shut down the system - it should already in process, so the first thing to check is if there are any more hidden forms running? The only thing that will stop the auto-destroy is the SUPPRESSAUTODESTROY property - are you setting that anywhere in your app?

Next point - setting the SHUTDOWN property and calling the DESTROY method are doing the same thing - you don't need both - perhaps that might cause a conflict, though I couldn't think why off the top of my head.

Carl Pates

Call Set_Property_only( "SYSTEM", "SUPPRESSAUTODESTROY", TRUE$ )

SUPPRESSAUTODESTROY - is being set, that was going to be my next observation alert for you.

Also, where can I see what what forms are running. Debug show VSPRINTER2 as the only 'FORM' properties, started to help with report init speed.

Added a set_printer("TERM") but still shows in debug (I am probably down the wrong rabbit hole here).

My suspicion has always been the SUPPRESSAUTODESTROY (Just though now I could try setting to 0)

YEP!!

Call Set_Property_only( "SYSTEM", "SUPPRESSAUTODESTROY", false$ )

fixed the issue

Whoops, spoke too soon.

This works if I run oi with dv=1 and the tools→launch application.

But id run with dv=0 (run application) it comes up with error msg:

<appname> initialisation

PSSI.01: No visible entry window started for the <appname> application. Process aborted

*

then application close but revengine still running.

Trimmed down to this:

                     Call Set_Property_only( "SYSTEM", "SUPPRESSAUTODESTROY", false$ )
		Void = send_Event(MDI_Frame@, "CLOSE")
		Call Exec_Method( "SYSTEM", "DESTROY", "SYSTEM" )

This is the sledgehammer commands I also tried:

                    Call Set_Property_only( "SYSTEM", "SUPPRESSAUTODESTROY", false$ )
		foo  = set_printer("TERM",2)
		call set_property_only(MDI_Frame@, "VISIBLE",1)
		Void = send_Event(MDI_Frame@, "CLOSE")
		Void = Send_Event(@Window, "CLOSE")
		// Close the application
	       Call Exec_Method( "SYSTEM", "DESTROY", "SYSTEM" )

Obviously there is something else at play here.

Ok, now works, what you said earlier was correct about clash.

                     Call Set_Property_only( "SYSTEM", "SUPPRESSAUTODESTROY", false$ )
		Void = send_Event(MDI_Frame@, "CLOSE")
  • *→removed Call Exec_Method( "SYSTEM", "DESTROY", "SYSTEM" )

At 26 JAN 2022 06:35PM Carl Pates wrote:

For the avoidance of doubt - here's the pseudo-code for starting an application in the PS:

   if IsDevMode then

      StartWin = "RTI_IDE_BOOTLOADER"

   end else

      StartWin = appInfo<SYSAPPS_ENTRY_ENTITYID$>

   end

   

   if StartWin then

   

      SuppressAutoDestroy = TRUE$

      

      StartWindow( StartWin )

      

      SuppressAutoDestroy = FALSE$

      

      if WindowWasStarted then

         if WindowIsVisible then

            // All OK

         end else

            if HasotherVisiblePSWindows then

               // We're good

            end else

               ERROR: No visible entry window started for the %1% application

            end

            

         end

      end else

         ERROR: PSSI.02: Unable to start entry window "%1%" for the %2% application

      end

   

   end else

      ERROR: PSSI.00: No entry window defined for the %1% application.

   end

   

   if ERROR then

      if SysMonIsVisible then

         OutputErrorToSysMon

      end else

         DestroySystem

      end

   end

Carl Pates

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/f3dd0e57eaf69c4d8cdf8ec279aff500.txt
  • Last modified: 2024/01/04 20:57
  • by 127.0.0.1