don't you just hate timers? I know I do (sort of ) They're never on time especially if you specify timers lower than approximately 50 ms and that's exactly what I want.
I know I can use GetPerformanceTimerCount, ect... But I want to create a timer I can leave behind, that will call a function without me checking the timer.
I've also found something about WaitableTimers, but that's not what I want either, because like I said I want to leave them alone, not call WaitForSingleObjectEx or something.
This is because I use a dll that sets timers on certain events. And the dll isn't allowed to slow down a thread by calling a wait function or looping to see if it is time yet. It has to give the calling thread back the focus.
So I thought of creating another thread that handles the timers (probably waitable timers). But how do I do this?
Because my dll is loaded by a lot of threads and I should only create one thread accessable to the dll (no matter what thread is calling it). I already have a FileMap to share variables over those calling threads, can I also add the thread there or something?
(btw how could I call a function in the created thread from my dll? or should I create another waitable timer i can set my dll (or some kind of event or queue))
Hum, I've read this again, and I think I have to read something about threads again, because they're not really clear to me yet. They're run in the same address space as the creating thread, so it could use the same vars? (the creating thread would now be the calling thread of the dll???)
And about creating only one extra thread. I've thought about it, and I always have at least one thread attached to it, so I could create a thread in the address space of that process. But I'm still a little unsure of how to tell it to create another timer...