Replacement for Quit() ?

This forum is meant for questions and discussions about the X# language and tools
Frank Müßner
Posts: 280
Joined: Sat Dec 12, 2015 2:22 pm
Location: Germany

Replacement for Quit() ?

Post 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
NickFriend
Posts: 248
Joined: Fri Oct 14, 2016 7:09 am

Replacement for Quit() ?

Post 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
User avatar
robert
Posts: 4520
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Replacement for Quit() ?

Post by robert »

Frank

For windows forms you can use Application.Exit()
And there is also Environment.Exit()

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Frank Müßner
Posts: 280
Joined: Sat Dec 12, 2015 2:22 pm
Location: Germany

Replacement for Quit() ?

Post by Frank Müßner »

Hi Robert,

not for WinForms.
Transported VO Code. There is SELF:Quit(), but i dos not work.

Frank
User avatar
Chris
Posts: 4907
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Replacement for Quit() ?

Post 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
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Frank Müßner
Posts: 280
Joined: Sat Dec 12, 2015 2:22 pm
Location: Germany

Replacement for Quit() ?

Post 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
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Replacement for Quit() ?

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Frank Müßner
Posts: 280
Joined: Sat Dec 12, 2015 2:22 pm
Location: Germany

Replacement for Quit() ?

Post 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
User avatar
wriedmann
Posts: 3755
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Replacement for Quit() ?

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Frank Müßner
Posts: 280
Joined: Sat Dec 12, 2015 2:22 pm
Location: Germany

Replacement for Quit() ?

Post 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
Post Reply