Results 1 to 5 of 5

Thread: Why won't my exe end

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2001
    Location
    Chicago
    Posts
    40

    Question Why won't my exe end

    Here's the situation, my app uses the Domino com object to send an email. If the mail server is down, it uses a trappable error to notify the user that the server is down. Here's the problem, when the user clicks the exit button and the form disappears, the program is hogging huge amounts of cpu time in the Processes of Task Manager. Any ideas?

    Here is my code to quit:

    In the form:

    Private Sub cmdExit_Click()

    Unload Me
    Call Public_Form_QueryUnload(0, 1)
    End

    End Sub

    In a module:

    Public Sub Public_Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)

    Set DomSession = Nothing
    Shell_NotifyIcon NIM_DELETE, t 'Deletes from SysTray

    Exit Sub

    End Sub

  2. #2
    Fanatic Member Blade's Avatar
    Join Date
    Jan 1999
    Location
    Stoke-on-Trent, UK
    Posts
    527
    Hi,
    You shouldn't really have any code at all after the Unload Me statement as this is probably causing your form to kick back in again.

    Try swapping the Unload Me and the call to the Sub around.

    Blade

  3. #3

  4. #4

    Thread Starter
    Member
    Join Date
    Jan 2001
    Location
    Chicago
    Posts
    40

    Angry No Go

    That did not work. It still showed up in my Processes with a CPU time of 99. Not sure why it works fine when the server is up.

  5. #5
    Super Moderator Wokawidget's Avatar
    Join Date
    Nov 2001
    Location
    Headingly Occupation: Classified
    Posts
    9,632

    Talking Bats and balls are boring...no wait...Nope, still boring.

    Try:
    VB Code:
    1. Private Sub cmdExit_Click()  
    2.    Call Public_Form_QueryUnload(0, 1)
    3.    Unload Me
    4. End Sub
    5.  
    6. 'In a module:
    7.  
    8. Public Sub Public_Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    9.    Shell_NotifyIcon NIM_DELETE, t 'Deletes from SysTray
    10.    Set DomSession = Nothing
    11. End Sub
    By the way, what is 't'?

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