[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Missing Events

Posted on 2002-06-28
5
Medium Priority
?
290 Views
Last Modified: 2008-01-09
Is it possible for Visual Basic to be so busy with tasks as to cause it to miss events?
I ask because this is my situation:
I have two projects. One is nothing but a form, with some functions that raise an event. When I run this program, the event always triggers as it's supposed to.
The other program has the identical code that generates the event but has many other items on the form, such as timers controls, etc.. When I run this project the event doesn't fire as it should unless I repeatedly click the command button that I'm using to test the event. Is there a way to "force" VB to look for events? or maybe stop what it's doing and watch for an event for, say , 2 seconds?..
I realize this question is general. I have source code if anyone is interested but I'm hoping I don't have to do that..
Thanks again!
Jeff
0
Comment
Question by:jscharpf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 14

Accepted Solution

by:
mcrider earned 1500 total points
ID: 7117269
I believe what you're looking for is the DoEvents function. Place it in your loops and timer events when they're tight. This will allow the system to process other events (like clicks).

BE CAREFUL WITH THIS FUNCTION!!!

Read the help page for it before use it! You can cause yourself alot of headaches with this... Like multiple fireing of events where data can be overwritten in a variable...

Cheers!®©
0
 

Author Comment

by:jscharpf
ID: 7117302
I had alot of do events in there and it didn't solve it but I found out my problem.
It had to do with the actual function so I think I got it fixed
 
THanks!

0
 
LVL 14

Expert Comment

by:mcrider
ID: 7117318
You're welcome!
0
 
LVL 22

Expert Comment

by:cookre
ID: 7117319
Your mention of 'timers, etc' set off a small alarm.

Recall that timer events take priority over many others.

One is tempted to suspect that your timer interval interval is too small or what you're doing on each hit is too much - so much so that all you end up doing is handling the never ending sequence of timer events that keep jumping in line ahead of other queued events.

If that's the case, one way to deal with it is to disable the timer while you're handling the event, then restart it just before exiting the event.
0
 

Author Comment

by:jscharpf
ID: 7117339
Great idea!!! I will try disabling the timers and see if that helps!

Thanks!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question