Results 1 to 2 of 2

Thread: Processing focus

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2000
    Location
    Gloucestershire, England
    Posts
    301

    Post

    When I quit my program I want to wait until a function (already running) finishes.

    How do I do this? What I did have was:

    Private Sub MDIForm_QueryUnload(Cancel As Integer, UnloadMode As Integer)


    gvMonitor.Stop = True
    Close #1
    do while gvstatus.monitor=true

    End Sub

    when my function finishes it sets gvstatus.monitor=false

    However when I run this my program spends all its time in the checking loop in QueryUload and no time finishing my function.

    I have tried putting a DoEvents in the loop, but unsuprisingly this did`nt make any difference.

    Any ideas?

    What I really need is some way of letting the background function process while checking it on the foreground

    Thanks for any help

  2. #2
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363

    Post

    Rick,
    In your Unload Event:
    Code:
    If gvstatus.monitor=true Then
    Cancel = True
    Exit Sub
    In your function:
    Code:
    gvstatus.monitor = false
    Unload Form1
    Wade

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