Op opening a serial port you initialise two data buffers for incomming and outgoing traffick. Under windows you don not have direct access to the hardware on the serial port and the flow between the buffers and the serial port drivers is controlled by windows.
When you write data to a serial port you write data to the buffer and the software buffer feeds that to the hardware buffers and the serial device attached to the port will clock the data from the buffer, i.e. if hardwar handshaking is enabled it relies on the hardware lines handshaking properly and data is send in a controlled fashion between devices based on the configured baudrate of the port.
The same happens on the receiving side. The hardware clock data in at the defined baudrate and keeps th
at in the serial buffer untill it is read by you in a soft routine. This whole process relies on the hardware handshaking used in your application. Read more on this by doing a web search on "fundamentals of serial communication".
To set control colors use:
SetCtrlAttribute (handle, ControlID, ATTR_TEXT_COLOR, VAL_RED);
Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd