m_strlcomm 是MScomm的一个控件名,它包含了很多函数,例如在我写完m_strlcomm. 后就会出现提示的很多函数,我想了解这些函数的功能,但在MSDN中找不到!我该怎么找哪?
Handshake Constants
Constant Value Description
comNone 0 No handshaking.
comXonXoff 1 XOn/XOff handshaking.
comRTS 2 Request-to-send/clear-to-send handshaking.
comRTSXOnXOff 3 Both request-to-send and XOn/XOff handshaking.
OnComm Constants
Constant Value Description
comEvSend 1 Send event.
comEvReceive 2 Receive event.
comEvCTS 3 Change in clear-to-send line.
comEvDSR 4 Change in data-set ready line.
comEvCD 5 Change in carrier detect line.
comEvRing 6 Ring detect.
comEvEOF 7 End of file.
Error Constants
Constant Value Description
comEventBreak 1001 Break signal received
comEventFrame 1004 Framing error
comEventOverrun 1006 Port overrun
comEventRxOver 1008 Receive buffer overflow
comEventRxParity 1009 Parity error
comEventTxFull 1010 Transmit buffer full
comEventDCB 1011 Unexpected error retrieving Device Control Block (DCB) for the port
InputMode Constants
Constant Value Description
comInputModeText 0 (Default) Data is retrieved through the Input property as text.
comInputModeBinary 1 Data is retrieved through the Input property as binary data.
The MSComm control provides serial communications for your application by allowing the transmission and reception of data through a serial port.
Syntax
MSComm
Remarks
The MSComm control provides the following two ways for handling communications:
Event-driven communications is a very powerful method for handling serial port interactions. In many situations you want to be notified the moment an event takes place, such as when a character arrives or a change occurs in the Carrier Detect (CD) or Request To Send (RTS) lines. In such cases, use the MSComm control's OnComm event to trap and handle these communications events. The OnComm event also detects and handles communications errors. For a list of all possible events and communications errors, see the CommEvent property.
You can also poll for events and errors by checking the value of the CommEvent property after each critical function of your program. This may be preferable if your application is small and self-contained. For example, if you are writing a simple phone dialer, it may not make sense to generate an event after receiving every character, because the only characters you plan to receive are the OK response from the modem.
Each MSComm control you use corresponds to one serial port. If you need to access more than one serial port in your application, you must use more than one MSComm control. The port address and interrupt address can be changed from the Windows Control Panel.
Although the MSComm control has many important properties, there are a few that you should be familiar with first.
Properties Description
CommPort Sets and returns the communications port number.
Settings Sets and returns the baud rate, parity, data bits, and stop bits as a string.
PortOpen Sets and returns the state of a communications port. Also opens and closes a port.
Input Returns and removes characters from the receive buffer.
Output Writes a string of characters to the transmit buffer.