Page 1 of 2
Replacement for Quit() ?
Posted: Mon Aug 28, 2017 1:36 pm
by Frank Müßner
Hi,
what is the correct Replacement for _Quit() or Quit() or App:Quit() ?
No call is not terminated the Program.
Frank
Replacement for Quit() ?
Posted: Mon Aug 28, 2017 2:12 pm
by NickFriend
If you're using WPF you can use Application.Shutdown(), which then allows you to use Application.Current.ShutdownMode to define under what circumstances the app should exit.
Don't know about WinForms, sorry.
HTH
Nick
Replacement for Quit() ?
Posted: Mon Aug 28, 2017 2:16 pm
by robert
Frank
For windows forms you can use Application.Exit()
And there is also Environment.Exit()
Robert
Replacement for Quit() ?
Posted: Mon Aug 28, 2017 2:49 pm
by Frank Müßner
Hi Robert,
not for WinForms.
Transported VO Code. There is SELF:Quit(), but i dos not work.
Frank
Replacement for Quit() ?
Posted: Mon Aug 28, 2017 6:45 pm
by Chris
Hi Frank,
Normally App:Quit() should work, can you please give us some more info on what is happening?
Does it give you a runtime error message, or does it not just terminate the app?
When are you calling it? Can you share the code?
Chris
Replacement for Quit() ?
Posted: Tue Aug 29, 2017 6:02 am
by Frank Müßner
Hi Chris,
simple not terminate the app.
Method Start()
....
....
LOCAL Starttb AS Textbox
XStools:=XSharp.AClass{}
//Lokale Sqllite Datei erstellen und prüfen
IF ! Createdblokal()
Starttb:=TextBox{,"Schwerer Fehler im Programmablauf","Lokale Datenbank konnte nicht angelegt, oder darauf zugegriffen werden. Bitte beim Support melden.",BUTTONOKAY}
Starttb:Show()
_Quit()
ENDIF
//Test Quit
SELF:Quit()
...
pszCommandLine:=GetCommandLine()
Frank
Replacement for Quit() ?
Posted: Tue Aug 29, 2017 7:06 am
by wriedmann
Hi Frank,
IMHO this is an error in the VO GUI classes - sometimes the application hangs somewhere, and is visible only in the task manager. And maybe this is more visible with X# compiled programs.
My own ported VO MDI application behaves exactly as its VO pendant.
I have this issue for years now - and in all of my VO applications.
Wolfgang
Replacement for Quit() ?
Posted: Tue Aug 29, 2017 7:18 am
by Frank Müßner
Hi Wolfgang,
i don´t understand what you mean.
With VO i can abort the app with call Quit() or SELF:Quit(). The sample that i have posted look in the Start() Method for necessities, and when not available the App have to Quit.
X# does not quit the app and perform the following code.
Frank
Replacement for Quit() ?
Posted: Tue Aug 29, 2017 7:28 am
by wriedmann
Hi Frank,
a ported VO application does not use the .NET GUI (WinForms/WPF) classes, but the VO GUI classes.
Therefore the source for your problem is to search there.
Wolfgang
Replacement for Quit() ?
Posted: Tue Aug 29, 2017 9:21 am
by Frank Müßner
Hi to all,
I have found that only when debug the App, Self:Quit() is not perform.
When run the app it work´s like in VO.
Frank