469,571 Members | 1,330 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,571 developers. It's quick & easy.

Any way to prevent timer event from being interrupted by other code?

I have a timer which goes off every second and executes some code. I
also have a menu item that sets some variables to NOTHING. The
problem is that the timer uses some of those variables. If I execute
the menu item while the timer is firing an event, I get a crash.
So I need to make the menu item wait for a timer event to be finished
before the menu item executes its own code. Is there a way to do this
- perhaps with 'synclock' on some variable that the two routines have
in common?
Thanks,
HA

Sep 5 '07 #1
1 1316
In addition to "rome_newsgroups" it's IMO always good to explain what you
are trying to do (so that someone could perhaps suggest a better approach
for what you are trying to do, for now it looks unusual to me having a menu
and a timer competing for the same elements).

<HO*************@YAHOO.COMa écrit dans le message de news:
11**********************@22g2000hsm.googlegroups.c om...
>I have a timer which goes off every second and executes some code. I
also have a menu item that sets some variables to NOTHING. The
problem is that the timer uses some of those variables. If I execute
the menu item while the timer is firing an event, I get a crash.
So I need to make the menu item wait for a timer event to be finished
before the menu item executes its own code. Is there a way to do this
- perhaps with 'synclock' on some variable that the two routines have
in common?
Thanks,
HA

Sep 5 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

31 posts views Thread by Derek Fountain | last post: by
8 posts views Thread by Daniel P. | last post: by
4 posts views Thread by Nijazi Halimaji | last post: by
8 posts views Thread by =?Utf-8?B?RGF2ZSBCb29rZXI=?= | last post: by
11 posts views Thread by =?Utf-8?B?RXJpYw==?= | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.