Com Ports and the MSComm Control

The MSComm Control

The next section of this tutorial will show you how to use the MSComm control. To add this control to your project, display the Components dialog (Project | Components...). Then scroll down, and check the box next to the Microsoft Comm Control. This control will only be available if you have Visual Basic Professional or above.

The Communications control provides an interface to a standard set of communications commands. It allows you to establish a connection to a serial port, connect to another communication device (a modem, for instance), issue commands, exchange data, and monitor and respond to various events and errors that may be encountered during a serial connection.

Possible Uses

  • To dial a phone number.
  • To monitor a serial port for incoming data.
  • To create a full-featured terminal program.

There are a number of sample applications that use the MSComm control. There are the the Dialer.vbp (in the Dialer folder) and VBTerm.vbp (in the MSComm folder) sample applications which are listed in the samples directory, demonstrate simple and complex (respectively) programming techniques of the Communications control. These are also available for download here. There is also another VB Web example, which you can download here. A screen shot is below.

You might also like...

Comments

About the author

James Crowley

James Crowley United Kingdom

James first started this website when learning Visual Basic back in 1999 whilst studying his GCSEs. The site grew steadily over the years while being run as a hobby - to a regular monthly audien...

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“God could create the world in six days because he didn't have to make it compatible with the previous version.”