473,750 Members | 2,470 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HRESULT: 0x800A1F52 error when running mscomm

25 New Member
I get the following error message when I output to the mscomm:

An unhandled exception of type 'System.Runtime .InteropService s.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 1704

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

Similar topics

1
6338
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 implementation is divided into two class: CTestInterface2, which implements the ITestInterfac2, and CTestInterface1, which implements ITestInterface1 AND ITestInterface2.
1
3870
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 I use a cellphone (Nokia 7210) with the same code, I get the above exception. The first communication with the phone is as follows: com_.Output = "ATZ;E\n";
4
5322
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 I have found are from VB6 which doesn't convert well. When I do try a new piece of code like: oChart.Legend.Position = Excel.XlLegendPosition.xlLegendPositionBottom
1
7463
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 = 3 mscomm1.PortOpen = True
4
10919
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 have it creating the groups just fine however when i go to add a user i get. The requested operation did not satisfy one or more constraints associated with the class of the object. (Exception from HRESULT: 0x80072014) And I can not find any help on...
7
14448
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 deploy nothing happens and if I stop the process winword in the tasks I receive the next message. If anyone knows the solution I am very thankful. Thanks,
0
1578
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, n store the data in to one string type variable , msStr but some time it store the Mscomminput, n some times it stores nothing, but in mscomm.input will have a GPS data, why it is So?
6
5287
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 GetIndicator_Info() Dim Len As Byte = 6 Dim Cmd As Byte = 7 Dim loPass_byte As Byte = 28
1
3287
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 this up in the forum and all AT commands ends with VbCr, and i have done the rest of the options also. PLease help on this matter... Here is a section of my code Public Function ResponseCheck() As Boolean Dim Buffer As String ...
0
8840
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9584
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9399
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9259
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4717
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4895
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3328
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2228
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.