i already add the mycomm.lib into my visual basic by clicking Project-> Add reference -> Com Tab -> choose mycomm control 6.0. But i still dunno how to use it. What i want is to send a character From visual basic express 2010 to Microcontroller.
-
1It is a stone cold old VB6 control. Amazingly, the [documentation](http://msdn.microsoft.com/en-us/library/aa259393%28v=VS.60%29.aspx) for it is still available. Not such a great choice for talking to a microcontroller unless you restrict yourself to readable strings instead of bytes. Use SerialPort instead. – Hans Passant Mar 15 '13 at 13:54
1 Answers
The MSComm Control 6.0 is intended for use with a very old version of Visual Basic (VB 6.0) that is completely incompatible with VB.NET (which is what you have now, in Visual Basic 2010). This old control is provided only for backwards compatibility and is not recommended for use in new applications.
The .NET Framework provides the System.IO.Ports.SerialPort
class, which is what you should be using instead. I think you'll find it much easier to work with, since it was designed with VB.NET in mind.
You can find some very comprehensive sample code at the bottom of the above-linked documentation. And if that doesn't serve your purposes, you can surely find lots of sample code elsewhere online now that you know the magic term to unlock the oracle of Google.

- 239,200
- 50
- 490
- 574