SocketMonkey
October 28th, 1999, 04:02 PM
Hello there. I'm trying to use my COM1 port to send/receive messages through my modem. I think the problem may be that I'm not declaring the MSComm control properly. Whenever I run the code, I get an error saying "Object variable with block variable not set." I have no idea what that means, so if you could please help me, I'd be very grateful. Here's the first part of the code:
Option Explicit
Dim mscomm1 As Control 'Is that right?
Dim InBuff As String
Private Sub Form_Load()
' Use COM1.
mscomm1.CommPort = 1 'the debugger goes to this line first
' 9600 baud, no parity, 8 data, and 1 stop bit.
mscomm1.Settings = "9600,N,8,1"
' Tell the control (MSComm1) to read entire buffer when Input
' is used.
mscomm1.InputLen = 0
' Open the port.
mscomm1.PortOpen = True
Text1.Text = "ping www.altavista.com"
End Sub
Many, many thanks in advance!
Option Explicit
Dim mscomm1 As Control 'Is that right?
Dim InBuff As String
Private Sub Form_Load()
' Use COM1.
mscomm1.CommPort = 1 'the debugger goes to this line first
' 9600 baud, no parity, 8 data, and 1 stop bit.
mscomm1.Settings = "9600,N,8,1"
' Tell the control (MSComm1) to read entire buffer when Input
' is used.
mscomm1.InputLen = 0
' Open the port.
mscomm1.PortOpen = True
Text1.Text = "ping www.altavista.com"
End Sub
Many, many thanks in advance!