i'm making a 384 channel light controller , controlled through the parallel port. And my ic's don't support the speed the bits are fed. so i need a small pause every time i have an out put.
I would go with calling the Sleep() API within that loop, perhaps with a delay value like 100 ms and then loop with Sleep() and DoEvents about 9 or 10 times.
This will leave your PC more responsive for other activities while your light controller program runs, and your program will be able to respond to "Cancel" button events as well. Have any cancel event handler set a module-global Boolean and be sure to test for this becoming True within your loop and take appropriate action.
This is a common type of thing, people use it for open-loop control of external devices such as EEPROM programmers all the time. I agree with CCLINT that a search here or on Google will get you to info on Sleep() pretty easily.
What sort of stinks is that DoEvents actually already calls Sleep() now, but it passes 0 as the time interval for "sleeping." Ah, if only they had provided the option of an interval parameter to DoEvents! But I suspect they were worried VB programmers would get themselves into trouble. A lot of VB is about providing padded, rounded surfaces so baby won't bump his head. I'd love to see a VB 6.1 that didn't make you ride in the child seat by default.
You just need to be like Tommy in Rug Rats, and use your screwdriver to pry the lock on the playpen open. Turns out it isn't all that hard.
This link describes Word VBA, but it applies as-is to VB6 as well:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.