473,386 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Visual Basic .net MSComm control

Hi:
I have a question about the Microsoft Communications Control Version 6.0
from visual studio .net.
I have this code:

Dim Buffer As String
Do
Buffer = AxMSComm1.Input() //Error, it does not recognize this
statement.
Loop Until Len(Buffer) > 0
AxMSComm1.PortOpen = False

Could someone tell me why I get this error or where I can find information
on using this ActiveX control. I went to the MSDN website but could not find
any information about this control. The MSDN site only referred me to MSComm
from visual basic 6.0.

Thanks.
Nov 20 '05 #1
6 8196
Do you really need to use the ActiveX control? Personally I wouldn't for .NET, I've used it with VB6 and yes it works fine but for VB.NET I would look at other methods. May be one of the following links will help.

http://support.microsoft.com/default...b;en-us;823179
http://www.microsoft.com/downloads/d...C-B4ED37A1578B
http://www.codeproject.com/dotnet/DotNetComPorts.asp
http://msdn.microsoft.com/msdnmag/is...netserialcomm/
http://www.htservices.com/Tools/VBan...unications.htm
Chris.
"Tico Tech" wrote:
Hi:
I have a question about the Microsoft Communications Control Version 6.0
from visual studio .net.
I have this code:

Dim Buffer As String
Do
Buffer = AxMSComm1.Input() //Error, it does not recognize this
statement.
Loop Until Len(Buffer) > 0
AxMSComm1.PortOpen = False

Could someone tell me why I get this error or where I can find information
on using this ActiveX control. I went to the MSDN website but could not find
any information about this control. The MSDN site only referred me to MSComm
from visual basic 6.0.

Thanks.

Nov 20 '05 #2
Further to this response ...

HTS recommends Corrado Cavallis's web pages, as I too have been pointing
people to for some time. However, there is a major flaw in the code there,
which Corrado is aware of, and is correcting, I believe.

In the meantime, if you use his code - which is otherwise a very good place
to start - I suggest you refer to the article below

http://msdn.microsoft.com/msdnmag/is...netserialcomm/

and pay particular attention to the section that describes marshalling of
the overlapped structures. This is very important, and could save you a lot
of heartache when your application mysteriously crashes without so much as a
'by your leave'.

Although I read it at the same time as I came across Corrado's page, I did
not give it my fullest attention, and spent several weeks debugging random
crashes.

HTH

Charles
"Chris Podmore" <Ch**********@discussions.microsoft.com> wrote in message
news:6A**********************************@microsof t.com...
Do you really need to use the ActiveX control? Personally I wouldn't for ..NET, I've used it with VB6 and yes it works fine but for VB.NET I would
look at other methods. May be one of the following links will help.
http://support.microsoft.com/default...b;en-us;823179
http://www.microsoft.com/downloads/d...C-B4ED37A1578B http://www.codeproject.com/dotnet/DotNetComPorts.asp
http://msdn.microsoft.com/msdnmag/is...netserialcomm/
http://www.htservices.com/Tools/VBan...unications.htm
Chris.
"Tico Tech" wrote:
Hi:
I have a question about the Microsoft Communications Control Version 6.0
from visual studio .net.
I have this code:

Dim Buffer As String
Do
Buffer = AxMSComm1.Input() //Error, it does not recognize this
statement.
Loop Until Len(Buffer) > 0
AxMSComm1.PortOpen = False

Could someone tell me why I get this error or where I can find information on using this ActiveX control. I went to the MSDN website but could not find any information about this control. The MSDN site only referred me to MSComm from visual basic 6.0.

Thanks.

Nov 20 '05 #3
Hi,

I have a number of examples in my book (see below). Without seeing more of
your code, I cannot be sure what you are doing wrong. You can download
NETComm.ocx from my homepage, which comes with a working example that may
clear things up.

As others have mentioned, there are .NET classes and components available,
that do not rely on an AX control. I provide one in my book, and there are
others available. There is a nice component from Sax Software that is in
the Visual Basic . NET Resource Kit (a free download from Microsoft, or
available for about $5 shipping on a CD-ROM).

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.
Nov 20 '05 #4
Mark,

I've replied to your message in the DBComm work space. The code works fine.

Chris.

"Mark Wills" wrote:
Hi Chris,

No - i'm afraid I didn't - but I've been a bit distracted of late... I needed to know how to compile it so that I could use it in my own apps - like you would in the old days of VB6, but nobody replied :-(

Mark.
"Chris Podmore" wrote:
Hi Mark,

Good first post.
Thanks for letting us know about DBComm. Looks interesting, I'll have to download it and have a look when I get some time.

I notice you had a message on the message board asking how to use the control and no one had replied. Did you work it out?

Chris.

"Mark Wills" wrote:
Hi there,

A .Net control (written in fully managed code) has been developed that closely emulates the original MSComm control.

You can download it for free from www.gotdotnet.com

Do a search for DBComm and you should find it. It works just like the original, but is written in vb.net - you can either use it as is, or, look at the guts of it to see how the author actually got access to the serial ports and then roll your own version. Hope this helps. (this is my first post in this newsgroup!)

Regards

Mark Wills
"Tico Tech" wrote:

> Hi:
> I have a question about the Microsoft Communications Control Version 6.0
> from visual studio .net.
> I have this code:
>
> Dim Buffer As String
> Do
> Buffer = AxMSComm1.Input() //Error, it does not recognize this
> statement.
> Loop Until Len(Buffer) > 0
> AxMSComm1.PortOpen = False
>
> Could someone tell me why I get this error or where I can find information
> on using this ActiveX control. I went to the MSDN website but could not find
> any information about this control. The MSDN site only referred me to MSComm
> from visual basic 6.0.
>
> Thanks.
>
>
>

Nov 20 '05 #5
Found the solution! No need beat around the bushes...with HTS

Dim Buffer As String
' Wait for data to come back to the serial port.
Do
Buffer = CStr(Me.AxMSComm1.Input())
Loop Until Len(Buffer) > 0
'Display data or do something with it
Me.Text1.Text = Buffer
'Close Port
Me.AxMSComm1.PortOpen = False

Thanks anyway guys.

"Tico Tech" <ap*********@hotmail.com> wrote in message news:29XNc.60$Bb.39@lakeread08...
Hi:
I have a question about the Microsoft Communications Control Version 6.0
from visual studio .net.
I have this code:

Dim Buffer As String
Do
Buffer = AxMSComm1.Input() //Error, it does not recognize this
statement.
Loop Until Len(Buffer) > 0
AxMSComm1.PortOpen = False

Could someone tell me why I get this error or where I can find information
on using this ActiveX control. I went to the MSDN website but could not find
any information about this control. The MSDN site only referred me to MSComm
from visual basic 6.0.

Thanks.

Nov 20 '05 #6
Found the solution! No need beat around the bushes...with HTS

Dim Buffer As String
' Wait for data to come back to the serial port.
Do
Buffer = CStr(Me.AxMSComm1.Input())
Loop Until Len(Buffer) > 0
'Display data or do something with it
Me.Text1.Text = Buffer
'Close Port
Me.AxMSComm1.PortOpen = False

Thanks anyway guys.

"Tico Tech" <ap*********@hotmail.com> wrote in message news:29XNc.60$Bb.39@lakeread08...
Hi:
I have a question about the Microsoft Communications Control Version 6.0
from visual studio .net.
I have this code:

Dim Buffer As String
Do
Buffer = AxMSComm1.Input() //Error, it does not recognize this
statement.
Loop Until Len(Buffer) > 0
AxMSComm1.PortOpen = False

Could someone tell me why I get this error or where I can find information
on using this ActiveX control. I went to the MSDN website but could not find
any information about this control. The MSDN site only referred me to MSComm
from visual basic 6.0.

Thanks.

Nov 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: jinoy | last post by:
how can i detect an incoming caller's telephone keystroke using modem, using mscomm or other? how can i detect an outgoing call using mscomm? how can i get a caller id using mscomm?
4
by: AA | last post by:
Hi I am developing an app in which I have used a MSComm object. I have opened the port, performed the transactions, and then closed the port. But when I check in the task mamager, the memory...
1
by: Ken Maitland | last post by:
I have a version of mscomm32.ocx on my machine which is dated 1997. I assume this is the version that came with my Visual Development suite 97. I did not buy a Version 6 and went straight to...
3
by: Gurinder | last post by:
Hi, Do you know how to use serial port in VisualBasic.Net and what is the object name to use. Thanks, Gurinder
6
by: Barry Martin | last post by:
I am using an activex control mscomm to control a serial port in VB.NET. I place the control on the main form and set its port, baud rate, etc. properties. After creating a code module that needs...
1
by: Barry | last post by:
I am using the mscomm activex control in vb.net. I can add the control to the toolbar which will allow me to drop it onto a form. As long as I am in the code space for that form it works fine....
4
by: ifitzgerald | last post by:
Hi, I am modifying a rather large and complex MFC application (written by someone else) written in Visual C++ 6.0 with service pack 6. I need to add serial communication functionality to the...
0
by: swati2106 | last post by:
HI, I have develop a apllication , To store the GPS data in database, for that , to read GPS data I have used the Mscomm port, In which I create the object of class RS232 n open that port,...
3
by: MarkTingson | last post by:
Hello Scripters, I have a project that needs to connect with a bluetooth device. My bluetooth is connected to my USB Port..Is it possible to use MSCOMM control to access my bluetooth?. ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.