I need a timer in Windows 7 that calls a function when the time interval has elapsed and does not block the threat it is on. In other words, I can’t use delay().
I’ve been trying to use IMFTimer to generate a callback with the following code:
IMFTimer *playbackEndTimer;
HRESULT hr = CoCreateInstance(__uuidof(IMFTimer), NULL, CLSCTX_ALL, IID_PPV_ARGS(&playbackEndTimer));
CoCreateInstance returns “class not registered”. It also looks like I will need to use IMFAsyncCallback as the callback, and I have not been able to figure out how to do that from the documentation.
Is there a better way? Can somebody point me to some working source code?
OK, that was a somewhat stupid question. I should have used the old SetTimer() without trying to use IMFTimer::SetTimer(). Problem solved.