如何使用CreateSystemTimer( )和KillSystemTimer( )?

满桌烟灰 2003-08-31 12:16:07
在网上的一篇文章介绍它们在文件SYSTEM.DRV里,但不知如何在C++ BUILDER 中使用SYSTEM.DRV?请各位大虾多多指教。
...全文
59 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
NowCan 2003-09-01
  • 打赏
  • 举报
回复
那个是Win32里的函数,Win9X和WinNT已经没有了。
Behard 2003-08-31
  • 打赏
  • 举报
回复
我能查到的信息
Knowledge Base Articles

DOCERR: How CN_RECEIVE Events Are Generated
Q101415


--------------------------------------------------------------------------------
The information in this article applies to:

Microsoft Windows Software Development Kit (SDK) 3.1

--------------------------------------------------------------------------------


SUMMARY
WM_COMMNOTIFY messages with CN_RECEIVE notifications are enabled when EnableCommNotification() is called with any number but -1 in the cbWriteNotify parameter. CN_TRANSMIT notifications are enabled when the cbOutQueue parameter is any number but -1. The CN_RECEIVE notifications are generated when either the number of characters in the receive queue exceeds cbWriteNotify, or a time-out occurs. Similarly, CN_TRANSMIT notifications are generated when the number of characters in the output queue drops below the cbOutQueue parameter.



MORE INFORMATION
When the COMM.DRV is loaded, it calls CreateSystemTimer() to create a 100 millisecond timer. When the timer goes off, COMM.DRV loops through all open ports, and does the "time-out check." The timer period is not configurable.

A CN_RECEIVE notification is generated if at receive interrupt time the following are true:



CN_RECEIVE notification is enabled.


The number of characters in the receive queue exceeds cbWriteNotify.


The number of characters in the receive queue has been below cbWriteNotify since the last CN_RECEIVE notification.

-or-


The following are true at time-out check:


CN_RECEIVE notification is enabled.


The port has at least one character in its receive queue.


The number of characters in the receive queue is less than cbWriteNotify.


A time-out CN_RECEIVE has not already been sent since the last character arrived at the port.


A CN_TRANSMIT notification is generated if at transmit interrupt time the following are true:


CN_TRANSMIT notification is enabled.


The number of characters in the transmit queue is less then cbOutQueue.


The number of character in the transmit queue has been above cbOutQueue since the last CN_TRANSMIT notification.


The Windows 3.1 Software Development Kit (SDK) documentation for EnableCommNotification() contains an incorrect sentence in the comments section:
Similarly, a WM_COMMNOTIFY message in which the CN_RECEIVE flag is set is sent only when the output queue is larger than the number of bytes specified in the cbOutQueue parameter.
This should be replaced by:
Similarly, a WM_COMMNOTIFY message in which the CN_TRANSMIT flag is set is sent only when the number of bytes in the output queue first exceeds and then falls below the number of bytes specified in the cbOutQueue parameter.
COMM.DRV has a bug that can generate extra CN_RECEIVE or CN_TRANSMIT notifications. For additional information, please see the following article in the Microsoft Knowledge Base:
Q101420 BUG: Extra CN_RECEIVE/CN_TRANSMIT Events

Additional query words: 3.10 no32bit docerr

Keywords : kb16bitonly
Issue type :
Technology : kbAudDeveloper kbWin3xSearch kbSDKSearch kbWinSDKSearch kbWinSDK310


Last Reviewed: November 6, 1999



--------------------------------------------------------------------------------

Send feedback to Microsoft

© 2002 Microsoft Corporation. All rights reserved.

1,221

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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