How do you set up a serial port MScomm object?
How do you set up a serial port MScomm object?
How do you set up a serial port MScomm object?
How do you set up a serial port MScomm object?
How do you set up a serial port MScomm object?
How do you set up a serial port MScomm object? How do you set up a serial port MScomm object? How do you set up a serial port MScomm object? How do you set up a serial port MScomm object? How do you set up a serial port MScomm object? How do you set up a serial port MScomm object? How do you set up a serial port MScomm object? How do you set up a serial port MScomm object?
How do you set up a serial port MScomm object? How do you set up a serial port MScomm object?
How do you set up a serial port MScomm object?
Go Back  Xtreme Visual Basic Talk > > > How do you set up a serial port MScomm object?


Reply
 
Thread Tools Display Modes
  #1  
Old 12-12-2002, 10:24 AM
vbad
Guest
 
Posts: n/a
Question How do you set up a serial port MScomm object?


I'm using VB6.0 on 2k.
Version 8176 VBA: Retail 6.0.8169

I'm writing a VB serial port radar control program and I took the sample serial port code off the Experts Exchange website. (It's also in the VB help example by the way)

Just to get stared and test things out,

In the Form_load I put this:

' Use COM1.
MSComm1.CommPort = 1
' 9600 baud, no parity, 8 data, and 1 stop bit.
MSComm1.Settings = "9600,N,8,1"
' Tell the control to read entire buffer when Input
' is used.
MSComm1.InputLen = 0
' Open the port.
MSComm1.PortOpen = True

IN the comLon_Click I put this:

Private Sub comLon_Click()
' Send the attention command to the modem.
''MSComm1.Output = "ATV1Q0" & Chr$(13)
MSComm1.Output = "1" & Chr$(13)
' Ensure that the modem responds with "OK".
' Wait for data to come back to the serial port.
''Do
''DoEvents
''Buffer$ = Buffer$ & MSComm1.Input
''''Loop Until InStr(Buffer$, "OK" & vbCrLf)
' Read the "OK" response data in the serial port.
End Sub

IN the form_unload I put this:

Private Sub Form_Unload(Cancel As Integer)
'Close the serial port.
MSComm1.PortOpen = False
End Sub

The problem is when I run the program I get
Runtime error '424' Object required on the
MSComm1.CommPort = 1
in form_load.

I haven't used VB much, so it could be something basic.
Is there something I need to do in order to create an mscomm object?

thanks in advance.
Reply With Quote
  #2  
Old 12-12-2002, 11:40 AM
Wamphyri's Avatar
WamphyriHow do you set up a serial port MScomm object? Wamphyri is offline
Variable not defined

Retired Moderator
* Guru *
 
Join Date: Apr 2002
Location: Ottawa, Ontario
Posts: 4,793
Default

You have to goto Projects -> Components and add Microsoft Comm Control 6.0

The MsComm component (an icon of a phone) will appear on your Components toolbar. Add that component to your form.
__________________
-Carl
Reply With Quote
  #3  
Old 12-12-2002, 11:42 AM
vbad
Guest
 
Posts: n/a
Default

Thanks Carl!
That's the answer.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
How do you set up a serial port MScomm object?
How do you set up a serial port MScomm object?
How do you set up a serial port MScomm object? How do you set up a serial port MScomm object?
How do you set up a serial port MScomm object?
How do you set up a serial port MScomm object?
How do you set up a serial port MScomm object? How do you set up a serial port MScomm object? How do you set up a serial port MScomm object? How do you set up a serial port MScomm object? How do you set up a serial port MScomm object? How do you set up a serial port MScomm object? How do you set up a serial port MScomm object?
How do you set up a serial port MScomm object?
How do you set up a serial port MScomm object?
 
How do you set up a serial port MScomm object?
How do you set up a serial port MScomm object?
 
-->