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

TOPIC:

Replacement for Quit() ? 28 Aug 2017 15:36 #2498

  • Frank Müßner
  • Frank Müßner's Avatar
  • Topic Author


  • Posts: 259
  • 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() ? 28 Aug 2017 16:12 #2499

    • NickFriend
    • NickFriend's Avatar


  • Posts: 242
  • 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() ? 28 Aug 2017 16:16 #2500

    • robert
    • robert's Avatar


  • Posts: 3447
  • Frank

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

    Robert
    XSharp Development Team
    The Netherlands

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

    Last edit: by robert.

    Replacement for Quit() ? 28 Aug 2017 16:49 #2501

    • Frank Müßner
    • Frank Müßner's Avatar
    • Topic Author


  • Posts: 259
  • 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() ? 28 Aug 2017 20:45 #2502

    • Chris
    • Chris's Avatar


  • Posts: 3844
  • 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() ? 29 Aug 2017 08:02 #2503

    • Frank Müßner
    • Frank Müßner's Avatar
    • Topic Author


  • Posts: 259
  • 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() ? 29 Aug 2017 09:06 #2504

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3297
  • 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

    www.riedmann.it - docs.xsharp.it

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

    Replacement for Quit() ? 29 Aug 2017 09:18 #2505

    • Frank Müßner
    • Frank Müßner's Avatar
    • Topic Author


  • Posts: 259
  • 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() ? 29 Aug 2017 09:28 #2506

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3297
  • 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

    www.riedmann.it - docs.xsharp.it

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

    Replacement for Quit() ? 29 Aug 2017 11:21 #2507

    • Frank Müßner
    • Frank Müßner's Avatar
    • Topic Author


  • Posts: 259
  • 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() ? 29 Aug 2017 18:45 #2508

    • Chris
    • Chris's Avatar


  • Posts: 3844
  • 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() ? 29 Aug 2017 19:46 #2509

    • robert
    • robert's Avatar


  • Posts: 3447
  • 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

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

    • Page:
    • 1