《Windows 核心编程》中讲到的函数

fwdever 2001-03-21 11:35:00
我正在学习《Windows 核心编程》,到第11 章线程池的使用时,为何那些函数如CreateTimerQueueTimer在MSDN中都找不到的?我的系统是Windows 2000,Visual Studio 6.0
...全文
113 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
Kevin_qing 2001-03-21
  • 打赏
  • 举报
回复
timers in a timer queue, call the DeleteTimerQueueEx function.

Requirements
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Unsupported.
Header: Declared in Winbase.h; include Windows.h.
Library: Use Kernel32.lib.

可能需要手工load
fwdever 2001-03-21
  • 打赏
  • 举报
回复
我要的不是这些函数的说明,而是这些函数从哪里Import的,因为《Windows 核心编程》所附源程序在VC中都不能编译通过。
sundayboys 2001-03-21
  • 打赏
  • 举报
回复
CreateTimerQueueTimer
The CreateTimerQueueTimer function creates a timer-queue timer. This timer expires at the specified due time, then after every specified period. When the timer expires, the callback function is called.

BOOL CreateTimerQueueTimer(
PHANDLE phNewTimer, // handle to timer
HANDLE TimerQueue, // handle to timer queue
WAITORTIMERCALLBACK Callback, // timer callback function
PVOID Parameter, // callback parameter
DWORD DueTime, // timer due time
DWORD Period, // timer period
ULONG Flags // options
);
Parameters
phNewTimer
[out] Pointer to a buffer that receives a handle to the timer-queue timer on return.
TimerQueue
[in] Handle to a timer queue. This handle is returned by the CreateTimerQueue function.
If this parameter is NULL, the timer is associated with the default timer queue.

Callback
[in] Pointer to the application-defined function of type WAITORTIMERCALLBACK to be executed when the timer expires. For more information, see WaitOrTimerCallback.
Parameter
[in] Specifies a single parameter value that will be passed to the callback function.
DueTime
[in] Specifies when the timer is to be set to the signaled state, in milliseconds.
Period
[in] Specifies the period of the timer, in milliseconds. If this parameter is zero, the timer is signaled once. If this parameter is greater than zero, the timer is periodic. A periodic timer automatically reactivates each time the period elapses, until the timer is canceled.
Flags
[in] This parameter can be one or more of the following values. Value Meaning
WT_EXECUTEINTIMERTHREAD The callback function is invoked by the timer thread itself. This flag should be used only for short tasks or it could affect other timer operations.
WT_EXECUTEINIOTHREAD The callback function is queued to an I/O worker thread. This flag should be used if the function should be executed in a thread that waits in an alertable state.
The callback function is queued as an APC. Be sure to address reentrancy issues if the function performs an alertable wait operation.

WT_EXECUTEINPERSISTENTTHREAD The callback function is queued to a thread that never terminates. This flag should be used only for short tasks or it could affect other timer operations.
Note that currently no worker thread is persistent, although no worker thread will terminate if there are any pending I/O requests.

WT_EXECUTELONGFUNCTION Specifies that the callback function can perform a long wait. This flag helps the system to decide if it should create a new thread.
WT_EXECUTEONLYONCE The timer will be set to the signaled state only once.


Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

16,550

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Creator Browser
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧