|
-
Jun 17th, 2010, 06:20 AM
#1
Thread Starter
Junior Member
Problem in Writing to a Serial Port Using Mscomm32.ocx control
Hi,
In my windows application I am using Mscomm32.ocx control for serial communication.
I set the control properties like below in the Form1_Load event.
AxMSComm1.CommPort = 1
AxMSComm1.Settings = "9600,N,8,1"
AxMSComm1.InputLen = 0
AxMSComm1.PortOpen = True
AxMSComm1.SThreshhold=1
AxMSComm1.RThreshhold=1
I did the same way as mentioned in the following link.
http://support.microsoft.com/kb/139526/en-us
But I am getting the following error when I try to write data to a serial port using output method.
AxMSComm1.Output {"Exception from HRESULT: 0x800A018A (CTL_E_GETNOTSUPPORTED)"} Object
Please tell me why I am getting this error and how to resolve this???
Thanks in advance.
-
Jun 17th, 2010, 06:48 AM
#2
Re: Problem in Writing to a Serial Port Using Mscomm32.ocx control
Is there a reason you are not using the .Net SerialPort?
-
Jun 17th, 2010, 07:00 AM
#3
Thread Starter
Junior Member
Re: Problem in Writing to a Serial Port Using Mscomm32.ocx control
Hi,
I developed a application for serial communication using that control.
I saw in so many websites where ever serial communication happend using this control they did in the same way.
I just want to know why I am getting that error????
Thanks for your reply.
-
Jun 17th, 2010, 07:24 AM
#4
Re: Problem in Writing to a Serial Port Using Mscomm32.ocx control
You may have better luck getting an answer in the VB6 forum. The is .Net and .Net has a SerialPort Class that I assume is a replacement for MSComm.
-
Jun 17th, 2010, 07:30 AM
#5
Re: Problem in Writing to a Serial Port Using Mscomm32.ocx control
The link you posted is for FoxPro.
-
Jun 17th, 2010, 08:34 AM
#6
Thread Starter
Junior Member
Re: Problem in Writing to a Serial Port Using Mscomm32.ocx control
Hi,
in some other link also we can see the same thing.
http://msdn.microsoft.com/en-us/libr...8VS.60%29.aspx
my intension is writing data to a output buffer.
-
Jun 17th, 2010, 10:42 AM
#7
Fanatic Member
Re: Problem in Writing to a Serial Port Using Mscomm32.ocx control
Do you have VB6 installed on the same machine? If not, there may be a licensing issue (MSComm32.ocx is licensed to work with VB6). You can download NETComm.ocx, free, from my homepage -- www.hardandsoftware.net. It is licensed for any environment that supports ActiveX controls, and was originally developed for .NET.
Porting your code to use the built-in SerialPort object is the best move. Such a port shouldn't take more than an hour or so, even for a program that has a lot of serial port reads and writes. I'd really suggest that you go that route. I have a Terminal example on the same Software Downloads page that illustrates its use.
Dick
Richard Grier, Consultant, Hard & Software
Microsoft MVP (Visual Basic)
-
Jun 17th, 2010, 11:17 AM
#8
Addicted Member
Re: Problem in Writing to a Serial Port Using Mscomm32.ocx control
I read in one post with the same error that there was a problem with the port settings. They didn't post the changes that were made to correct it so not sure how much help that would be to you. May be worth taking a look at however.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|