-
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!
-
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
-
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.