Working with the Comm Control

The Comm control is an invisible ActiveX control that provides a connection to a serial port—also known as a communications port or COM port—on a Windows CE-based device. Your application can use the connection to communicate with devices, such as computers, modems, or Global Positioning System (GPS) receivers, that are connected to your device.

You can add the Comm control to a form or you can create the control at run time. To create a Comm control at run time, use the CreateObjectWithEvents function to gain access to the control’s OnComm event. The Comm control has no methods.

To use the newly created Comm control, you first must establish a connection to a serial port, a procedure similar to the procedure for using the MSComm control in Visual Basic 6.0. Once you establish the connection, you can send commands through the serial port to a device connected to the port. The following section explains the connection process.