Results 1 to 3 of 3

Thread: Counter, Timer, Pause or Something???

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 1999
    Posts
    3

    Talking

    I am using VB6. I am interacting with an activex control.
    I have tried using the timer control, the sleep function, but nothing seems to work as I need it to.

    Here is what does work(in English):

    total = TotalNumImages
    i = 1

    Do While i <= total

    Call CopyImage(x, xx)
    ****This is an asynchronous call meaning it MUST have enough time to complete before going thru the loop again.

    'sleep(15000)
    MsgBox "WAIT"
    ****If I count to 25 in my head while the WAIT msgbox is on the screen, the images copy without problem. I don't know why this works, except that perhaps the system is waiting on a user response it can finish processing the Call.

    i = i + 1
    Loop 'While

    The sleep function only copies about half the images. I think this is due to the fact that the copy has not completed when the sleep function starts.

    Any suggestions would be greatly appreciated! I would like this automated. Perhaps the OK button on the msgbox gets clicked after a certain amount of time. I have tried using the timer control, but have been unsuccessful. All I want is for the application to wait a bit before finishing the loop.

    Thank you very much for your time!

  2. #2
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617

    Do me a favor

    (Will sound odd!!) It may or may not work

    Put a DOEVENTS after the sleep or something

    Let me know....


    Thanks


  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Why not turn CopyImage into a synchronous function? It'll make your life easier. Anyway, why not have CopyImage set a global status variable, indicating that it's finished. It could also send an event, like the Winsock control.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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