how can i use the CreateTimerQueueTimer()?

Started by
21 comments, last by cambalinho 7 years, 11 months ago

        ULONG flags;
        DWORD dwPeridic;
        if(blnPeriodic==true)
        {
            flags = WT_EXECUTEDEFAULT;
            dwPeridic=(DWORD)intInterval;
        }
        else
        {
            flags = WT_EXECUTEDEFAULT | WT_EXECUTEONLYONCE;
            dwPeridic=0;
        }

        WT_SET_MAX_THREADPOOL_THREADS(flags,500);

Why not use the macro that actually exists, the way the documentation describes? The error you were getting is because the first parameter to the macro must be an assignable expression (an lvalue). Why do you need up to 500 threads to service your timer callbacks in the first place?

I have no idea what your (1) is asking.

As for your (2)... SetTimer() and KillTimer() deliver timer events as WM_EVENT events, and require a window handle. CreateTimerQueueTimer lets you specify arbitrary callback functions and callback parameters instead. AFAIK this design decision has nothing to do with the periodicity or precision of the timers associated with them.

RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.
Advertisement

i must use the CreateTimerQueueTimerWT_SET_MAX_THREADPOOL_THREADS() or i will get errors on lValue, like i said before.

That's because the macro is intended to modify the flags value given as the first parameter. It's not a function, its a textual substitution of an expression that performs and |= on the flags value. Don't treat it like a function. Call it like Wyrframe does in the above post.

thanks to all... thank you

This topic is closed to new replies.

Advertisement