CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2000
    Location
    canada
    Posts
    60

    Exit from application

    Hi, i've a problem my program. When i click in my menu button "Exit", i call "Unload me" and in the "Query_unload" i set my defined variables to "Nothing" and i Disable my timers (3). But the problem is that the application is always present in my TaskManager. Does someone have an idea about this problem or a peace of code to force the application to stop.

    Thanks in advance

    "the opposition of the opposites is the engine of becoming"

  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477

    Re: Exit from application

    You must make sure all form of the program are unloaded. If you have any other (like hidden) form open, the app won't exit. You can use the forms collection to check this, and unload them.

    private Sub mnuExit_Click()
    dim frm as Form
    for Each frm in Forms
    Unload frm
    next frm
    End Sub



    Also make sure you aren't looping (do loop using DoEvents) anymore, because when you're looping, the form you're looping is just won't unload.

    Tom Cannaerts
    [email protected]

    Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    Jun 2001
    Location
    Israel
    Posts
    228

    end

    try End



    ----------
    The @host is everywhere!
    ----------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured