|
-
Jan 19th, 2000, 11:22 PM
#1
Thread Starter
Hyperactive Member
While running the following code:
Do While (err = 0)
err = CANPC_read_ac(param)
frmMonitor.StatusBar1.SimpleText = "No new Can event"
Loop
none of my events (cancel_click) etc work. The program is in a loop waiting for err to change from zero. Is there anyway of checking the "event list" so that my buttons still work?
-
Jan 19th, 2000, 11:41 PM
#2
Hyperactive Member
I may be wrong but can't you put a DoEvents inside the loop? I haven't used it myself but I've seen it in code before. I believe that what it will do is check to see if there are any events waiting and it will do them.
-
Jan 19th, 2000, 11:53 PM
#3
Thread Starter
Hyperactive Member
Yup, this works a treat, Cheers!
-
Jan 20th, 2000, 01:10 AM
#4
Addicted Member
How do you use DoEvent? The MSDN Library seemed a bit vauge to me.
------------------
Micah Carrick
http://micah.carrick.com
[email protected]
ICQ: 53480225
-
Jan 20th, 2000, 01:13 AM
#5
Hyperactive Member
Micah, from what I've seen, basically you just put:
DoEvents
in your code and what it will do is check to see if there are any events (like mouse clicks or keypresses) and it will run them and then come back to your code. I think. :-)
-
Jan 20th, 2000, 01:19 AM
#6
Addicted Member
YES! That's beautiful. Cool, I'll play around with it.
-
Jan 20th, 2000, 01:19 AM
#7
Thread Starter
Hyperactive Member
DoEvents runs all the events saved up in the event list while your program was away doing much more interesting things.
In my case events were`nt getting handled at all because my program was in a Do While loop. Adding "DoEvents" in my loop cures this problem.
Thanks for the advice netsurfer. Cheers!
-
Jan 20th, 2000, 01:21 AM
#8
Hyperactive Member
no problem, this forum is where I learned about it too :-)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|