Re: Run thread every 1 minute - problems

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I don't think you've given us enough to answer your question. You're saying
that, when some button is hit in the application, you fire an event that is
supposed to notify the thread that it should exit? Or something else?

Paul T.

"Rob S" <RobS@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E5BFE6A0-EB39-4C3E-BAA9-BEA754931DFD@xxxxxxxxxxxxxxxx
> Hi there,
>
> Having an issue with RunAppAtTime
>
> I'm successfully running a thead every 1 minute, however when the user
> clicks a button the thread should not run again, however it just isn't
> working. Here's my code that isn't doing what it should be.
>
> if (updateReminder != null)
> {
> EventWaitHandle notifyEvent = new OpenNETCF.Threading.EventWaitHandle(
> false,
> OpenNETCF.Threading.EventResetMode.AutoReset,
> "SAMS_REMINDER_EVENT" );
>
> // Notify the thread to stop.
> notifyEvent.Set();
> notifyEvent.Close();
> }
>
> Anything blindingly obvious wrong there??
>
> I have exactly the same sort of thing working, and the same routine runs
> with the app exists, and that works fine.
>
> Many Thanks
> Rob


.


Quantcast