关于comm的问题

hzh_hyj 2005-06-18 01:36:22
请教关于comm的事件
...全文
129 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
hzh_net 2005-06-18
  • 打赏
  • 举报
回复
OnComm
This event occurs when the value of the CommEvent property changes, indicating that either a communication event or an error occurred.

Syntax
Private Sub comm_OnComm( )

Parameters
comm
Object expression that evaluates to a Comm control.
Remarks
The CommEvent property contains the numeric code of the actual error or event that generates the OnComm event. Note that setting the RThreshold or SThreshold properties to 0 disables trapping for the comEvReceive and comEvSend events, respectively.


hzh_net 2005-06-18
  • 打赏
  • 举报
回复
CommEvent
This property returns the most recent communication event or error.

Syntax
object.CommEvent

Parameters
object
Object expression that evaluates to a Comm control.
Remarks
The CommEvent property is unavailable at design time. It is read-only at run time.

Although the OnComm event is generated whenever a communication error or event occurs, the CommEvent property holds the numeric code for that error or event. To determine the actual error or event that caused the OnComm event, you must reference the CommEvent property.

The following table shows the CommEvent errors.

Constant Value Description
comNoError 0 No Error.
comEventBreak 1001 A break signal was received.
comEventCTSTO 1002 Clear To Send Timeout. The Clear To Send line was lower than the system- specified amount of time used when transmitting a character.
comEventDSRTO 1003 Data Set Ready Timeout. The Data Set Ready line was lower than the system specified amount of time used when to transmitting a character.
comEventFrame 1004 Framing error. The hardware detected a framing error.
comEventOverrun 1006 Port overrun. A character was not read from the hardware before the next character arrived and was lost.
comEventCDTO 1007 Carrier detect timeout. The carrier detect line was low for the system specified amount of time while trying to transmit a character. carrier detect is also known as the Receive Line Signal Detect (RLSD).
comEventRxOver 1008 Receive buffer overflow. There is no room in the receive buffer.
comEventRxParity 1009 Parity error. The hardware detected a parity error.
comEventTxFull 1010 Transmit buffer full. The transmit buffer was full when trying to queue a character.
comEventDCB 1011 Unexpected error retrieving Device Control Block (DCB) for the port.


The following table showss the CommEvent events.

Constant Value Description
comEvSend 1 There are fewer than SThreshold number of characters in the transmit buffer.
comEvReceive 2 Received RThreshold number of characters. This event is generated continuously until you use the Input property to remove the data from the receive buffer.
comEvCTS 3 Change in Clear To Send line.
comEvDSR 4 Change in Data Set Ready line. This event is fired only when DSR changes from 1 to 0.
comEvCD 5 Change in carrier detect line.
comEvRing 6 Ring detected. Some UARTs (universal asynchronous receiver-transmitters) may not support this event.
comEvEOF 7 End Of File (ASCII character 26) character received.



hzh_hyj 2005-06-18
  • 打赏
  • 举报
回复
自己先up一下

3,245

社区成员

发帖
与我相关
我的任务
社区描述
ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
社区管理员
  • ATL/ActiveX/COM社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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