fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Replacement for Quit() ?

Replacement for Quit() ? 1 year 6 months ago #1

  • Frank Müßner
  • Frank Müßner's Avatar Topic Author
  • Offline
  • Posts: 83
Hi,

what is the correct Replacement for _Quit() or Quit() or App:Quit() ?
No call is not terminated the Program.

Frank

Please Log in or Create an account to join the conversation.

Replacement for Quit() ? 1 year 6 months ago #2

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

Please Log in or Create an account to join the conversation.

Replacement for Quit() ? 1 year 6 months ago #3

Frank

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

Robert
XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

Last edit: by robert.

Replacement for Quit() ? 1 year 6 months ago #4

  • Frank Müßner
  • Frank Müßner's Avatar Topic Author
  • Offline
  • Posts: 83
Hi Robert,

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

Frank

Please Log in or Create an account to join the conversation.

Replacement for Quit() ? 1 year 6 months ago #5

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
XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

Replacement for Quit() ? 1 year 6 months ago #6

  • Frank Müßner
  • Frank Müßner's Avatar Topic Author
  • Offline
  • Posts: 83
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

Please Log in or Create an account to join the conversation.

Replacement for Quit() ? 1 year 6 months ago #7

  • wriedmann
  • wriedmann's Avatar
  • Offline
  • Posts: 1423
  • Karma: 6
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
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Replacement for Quit() ? 1 year 6 months ago #8

  • Frank Müßner
  • Frank Müßner's Avatar Topic Author
  • Offline
  • Posts: 83
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

Please Log in or Create an account to join the conversation.

Replacement for Quit() ? 1 year 6 months ago #9

  • wriedmann
  • wriedmann's Avatar
  • Offline
  • Posts: 1423
  • Karma: 6
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
This email address is being protected from spambots. You need JavaScript enabled to view it.
www.riedmann.it - docs.xsharp.it

Please Log in or Create an account to join the conversation.

Replacement for Quit() ? 1 year 6 months ago #10

  • Frank Müßner
  • Frank Müßner's Avatar Topic Author
  • Offline
  • Posts: 83
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

Please Log in or Create an account to join the conversation.

Replacement for Quit() ? 1 year 6 months ago #11

Hi Frank,

I think the difference between VO and x# is in the _Quit() function. Unfortunately I don't know exactly what it does in VO, but in the vulcan runtime it is implemented by calling the CloseMainWindow() method of the current process and this method sends a couple messages to the window to do it. Most probably in VO _Quit() does something little different.

My suggestion is to terminate the app with more control over what is happening exactly, for example by explicitly closing the main window of the app, or terminating the main execution loop if you have control over this etc.

Chris
XSharp Development Team
chris(at)xsharp.eu

Please Log in or Create an account to join the conversation.

Replacement for Quit() ? 1 year 6 months ago #12

Chris, Frank,

If I remember correctly then VO the _Quit function in VO does:
- call Axit on all active objects
- releases the dynamic memory
- releases the static memory
- releases other memory allocated by the runtime
- calls ExitProcess with an exit code
I may have forgotten something <g>.

Robert
XSharp Development Team
The Netherlands
This email address is being protected from spambots. You need JavaScript enabled to view it.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1