473,385 Members | 1,409 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,385 software developers and data experts.

HRESULT: 0x800A1F52 error when running mscomm

I get the following error message when I output to the mscomm:

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in COM.exe
Additional information: Exception from HRESULT: 0x800A1F52.


No one has been able to tell me why this isn't working. I know VB 2003 doesn't have serial control however I need to send this with the mscomm.


It will break at the line : comm1.Output = Packet(i)

Expand|Select|Wrap|Line Numbers
  1. Private comm1 As New MSComm
  2.  
  3. Public Sub SetupCOM(ByVal comPort As Integer)
  4. If IsNothing(comm1) Then
  5.     comm1 = New MSComm
  6. End If
  7. 'set the properties of the com port
  8. comm1.CommPort = comPort
  9. comm1.Settings = "57600,n,8,1"
  10. 'open the port and clear the buffer if it is not already open (which it better not be)
  11. If Not comm1.PortOpen Then
  12.     comm1.PortOpen = True
  13.     comm1.InBufferCount = 0
  14.     System.Threading.Thread.CurrentThread.Sleep(100)
  15. End If
  16. End Sub
  17.  
  18. Public Sub GetIndicator_Info()
  19. Dim i As Integer
  20. Dim Packet(6) As Byte
  21. Packet(0) = 42
  22. Packet(1) = 6
  23. Packet(2) = 7
  24. Packet(3) = 28
  25. Packet(4) = 45
  26. Packet(5) = 48
  27. Packet(6) = 130
  28.  
  29. For i = 0 To 5
  30.     comm1.Output = Packet(i)
  31.     Thread.Sleep(5)
  32. Next i
  33.  
  34. End Sub
Sep 23 '07 #1
0 1677

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Kimmo Laine | last post by:
Hi, we have a (unmanaged) ATL COM server, which implements two interface: ITestInterface1 and ITestInterface2. Both of these interfaces also support the ISupportErrorInfo-interface. Interface...
1
by: caid | last post by:
Hi there. I'm writing a C# app (in VS.NET 2003) that sends a binary sms using MSComm. I got it going with a gsm modem, but ideally we want to use a cellphone as the sending device. However, when...
4
by: KC | last post by:
Is this Exception from HRESULT: 0x800401A8 an error or a bug? I've been trying to build a chart in Excel through VB.net (which isn't documented) so I'm running completely blind. What examples...
1
by: Recep TARAKÇI | last post by:
hi everbody i am using visual basic 2005. i am write a modem control program and get callerID value. i am send a AT command to modem. Dim mscomm1 As New MSCommLib.MSComm mscomm1.CommPort...
4
by: cpajoe2001 | last post by:
I am not sure if this is the proper place to put this thread but I have run into a road block. I am writing a web app that will create groups in Active Directory then add users to those groups. I...
7
by: vmorikawa | last post by:
Hello ! Does anyone knows how to resolve that. I maked a simple project (Web Project) that open a document word and write some lines . Running with Visual Studio works well , but when I make a...
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,...
6
by: cmdolcet69 | last post by:
I get tis error message as soon as i a step into the comm1.Output = Packet(i) line of code. Below is my code could someone run this and see if they get the smae message? Public Sub...
1
by: AAAA84 | last post by:
I have program in VB 6 that used MSComm. I have upgraded it in VB.NET 2005. However. when i execute the program, i get an Exception from HRESULT: 0x800A1F52. I am using AT commands. I have looked...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.