The online racing simulator
Looping in background? (VB6)
(7 posts, started )
Looping in background? (VB6)
I guess there's a way since Mechanik and Tweak do it so how would I go about monitoring a memory value continuously but still allowing the rest of my app to be used? I tried a standard loop but, as I thought, it won't let me do anything else in the app.

Any ideas?
You would need to set it to run on a seperate thread. If you search your documentation for threading or multi-threading you should find it.
Why not just run a timer at a decent interval?
Quote from Leifde :I guess there's a way since Mechanik and Tweak do it so how would I go about monitoring a memory value continuously but still allowing the rest of my app to be used? I tried a standard loop but, as I thought, it won't let me do anything else in the app.

Any ideas?

What do you mean monitoring a memory value? Is there a variable to you are trying to see when it changes? or is it some external value (like memory used)

For the first, you'll want to just make the value a property on a class so that you get a way to intercept it being changed, at which time you can fire off an event to notify anyone who cares

For the second, either DarkTimes or Leifde's suggestion would work. A timer would get fired on its own thread (from the threadpool) every so often to check, while using a thread would required that you keep a loop running in the thread to check the value (and don't forget to sleep or you'll drive your CPU usage needlessly high)
Basically I want my program to notice when a memory value in another application (LFS) changes. By the sounds of it, a timer would be the best option.

P.S. I should go with my suggestion?
Quote from Leifde :P.S. I should go with my suggestion?

Heh, i meant to credit Rooble with the timer solution

But yeah, timer be perfect for that.
#7 - Blub
Try DoEvents on every single loop, should do what you want. If you can't catch every event try somthing like 4 times calling DoEvents in every loop.

Looping in background? (VB6)
(7 posts, started )
FGED GREDG RDFGDR GSFDG