On 5/21/07, Nigel Liang (梁乃強) <[EMAIL PROTECTED]> wrote:
Hi,

I am not quite sure I understand what you mean? CreateTimerQueueTimer
should return a Boolean indicating whether the operation has
succeeded. Checking the return value in a ternary operation should
return the correct handle if CreateTimerQueueTimer succeeds and NULL
otherwise. Unless I have misunderstood the msdn documentation?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_new/shlwapi_wrappers.asp


+    return CreateTimerQueueTimer(&hNewTimer, hQueue, pfnCallback, pContext,
+        dwDueTime, dwPeriod, dwFlags)?hNewTimer:NULL;

I'm pretty sure Dmitry did what I did.  That last little blurb at the
end (?hNewTimer:NULL;) is not very noticeable, and looks like the end
of the function arguments at first glance.  You really should get rid
of the ternary condition and split it out for code readability.

Also, please bottom-post on this list.


On 5/21/07, Dmitry Timoshkov <[EMAIL PROTECTED]> wrote:
> "Nigel Liang" <[EMAIL PROTECTED]> wrote:
>
> > +HANDLE WINAPI SHSetTimerQueueTimer(HANDLE hQueue,
> > +        WAITORTIMERCALLBACK pfnCallback, LPVOID pContext, DWORD dwDueTime,
> > +        DWORD dwPeriod, LPCSTR lpszLibrary, DWORD dwFlags)
> > +{
> ...
> > +    return CreateTimerQueueTimer(&hNewTimer, hQueue, pfnCallback, pContext,
> > +        dwDueTime, dwPeriod, dwFlags)?hNewTimer:NULL;
>
> This can't work: CreateTimerQueueTimer and SHSetTimerQueueTimer
> return different things.
>
> --
> Dmitry.
>





--
James Hawkins


Reply via email to